These instructions are for a Windows host, and assume that you're using Ollama. If you aren't using Ollama then there's no need to do any of the proxy stuff.
Ensure ollama is running in the host.
$env:OLLAMA_CONTEXT_LENGTH = 65536
ollama serveCreate an empty workspace directory. The name doesn't really matter, as it's just a placeholder for the template.
mkdir my-workspaceCreate a shell sandbox.
docker sandbox create --name agentc-template shell .\my-workspaceConfigure the proxy so that the sandbox can see Ollama.
docker sandbox network proxy agentc-template --policy allow --allow-host localhost:11434Run it.
docker sandbox run agentc-templateCheck that ollama is visible.
curl host.docker.internal:11434You should see Ollama is running.
Install Agent-C.
uv tool install git+https://github.com/badlydrawnrod/agent-cAppend the following to .bashrc.
# Run Agent-C if the shell is interactive.
if [[ $- == *i* ]]
then
export OLLAMA_HOST=http://host.docker.internal:11434/v1
uv tool run agent-c
fiYou may not have an editor in the sandbox, so one option is to copy .bashrc to the mounted my-workspace directory, edit it from the host, then copy it back.
Exit the sandbox, then re-run it to check that Agent-C starts.
docker sandbox run agentc-templateWhen the Agent-C prompt appears, enter something simple such as "What is the current directory?" You should get something sensible back.
Exit from Agent-C by pressing Ctrl+Q, then exit the sandbox.
Once back in the host, save the template as a Docker image.
docker sandbox save agentc-template agentc-python-sandbox:v1If you get an error saying that the host Docker is not available then you'll need to start it first.
To use the sandbox, first create it from your template, passing it the path of the directory to mount.
docker sandbox create -t agentc-python-sandbox:v1 shell C:\Projects\python\agent-cOnce it has been created, configure the proxy so that it can see Ollama. This is a one-off configuration for this sandbox.
docker sandbox network proxy shell-agent-c --policy allow --allow-host localhost:11434
Finally, run it.
docker sandbox run shell-agent-c