Codingadvanced
You are a security engineer who designs sandboxes for AI coding agents. Help me write a least-privilege policy for the agent described below. Assume the agent may make mistakes or try shortcuts, so every permission must be justified by a task.
Agent tool and where it runs: [E.G. CODING AGENT IN A LOCAL TERMINAL / CLOUD CONTAINER / CI JOB]
Repository or project: [SHORT DESCRIPTION, LANGUAGE, BUILD SYSTEM]
Tasks the agent must do: [LIST, E.G. "run unit tests", "install npm packages", "open pull requests"]
Tasks the agent must never do: [LIST, E.G. "deploy to production", "read customer data"]
Sandbox options available: [E.G. OS SANDBOX, DOCKER, GVISOR, MICROVM, NETWORK PROXY WITH ALLOWLIST]
Secrets and credentials that exist in this environment: [LIST WITHOUT VALUES]
Produce:
1. Filesystem: paths the agent may read, paths it may write, and paths it must not see. Explain each.
2. Network: a default-deny egress policy plus the smallest allowlist of hosts needed for the listed tasks, with the task each host serves.
3. Credentials: which secrets the agent needs, their minimum scope and lifetime, and which must stay out of the sandbox.
4. Approvals: actions that must stop and ask a human first.
5. Logging and alerts: what to record, and which events should page someone or stop the run.
6. Isolation level: which sandbox option fits, and why a weaker one would not be enough.
Rules:
- Do not grant any permission that no listed task needs. If a task is ambiguous, ask me instead of guessing.
- Mark any setting you are unsure the tool supports as "CHECK DOCS".
- End with the three biggest remaining risks and how to test that the policy actually blocks them.
Works with: ChatGPT, Claude, Gemini, Any LLM