Trust model
- The agent executes model-generated Python (
ipython) and shell (bash) commands with your user permissions. - IPython kernels and worker processes improve isolation but are not a security sandbox. See
SECURITY.mdin the repo. - The web server binds to
127.0.0.1and has no multi-user auth. Do not expose it beyond localhost without your own auth layer.
Credential storage
Credentials resolve, in order:- Runtime overrides (
setRuntimeApiKey, populated by--api-key). In-memory only. - Environment variables (
packages/ai/src/env-api-keys.ts), unless--no-envis set. ~/.prime/agent/auth.json(mode0600), throughFileAuthStorageBackend.- OAuth flows (
packages/ai/src/providers/oauth/) for providers that support them.
packages/ai no longer persists OAuth credentials itself; callers do (usually via auth.json). Long-running sessions refresh OAuth tokens dynamically via getApiKey so mid-run expiry doesn’t break the run.
Environment forwarding
DAEMON_CLIENT_ENV_KEYS in packages/coding-agent/src/modes/daemon/daemon-protocol.ts limits which env vars a client can forward to the daemon. Everything else stays on the client.
Optional OS sandbox
packages/coding-agent/examples/extensions/sandbox/index.ts adds an OS-level sandbox powered by @anthropic-ai/sandbox-runtime. It’s disabled by default. Enable it when running the agent against untrusted content or in shared environments.
Related
- Configuration — where credentials live.
- Web app — localhost binding, no multi-user auth.