Running AI agents safely
Starter and pro. For “I let an AI agent work on my code, in CI or in an eval. What should be true before I start it?”A coding agent, an agent job in CI and an eval script all have the same parts: a task, something that judges the result, permissions, a place to run, and a point where it stops. We call those parts the harness. This page is a checklist for the harness. It has seven items. Each says why it matters, where the reason comes from, and how to check it.
penthera agents already audits MCP servers, hooks, permissions and skills.
The checks marked (planned) below are specified in
spec-harness-rules.md and are not in any
release yet. Until they ship, check those items by hand.
The checklist
1. Say what is in scope
- The agent’s instructions name the files, services and hosts it may touch, and the network it runs on allows only those.
harness-no-scope and sandbox-egress-open (planned).
2. Give it a safe exit
- The instructions say what to do when the task is blocked, impossible or out of scope: stop, say so, and count that as an acceptable result.
harness-no-exit (planned).
3. Keep the judges out of reach
- The agent cannot edit the tests, test config, scorer, reward code or answer files that decide whether it succeeded.
- The judge checks the result itself, not the agent’s report of what it did.
harness-judge-writable and scorer-in-reach (planned). Whether
a judge trusts the agent’s own report: check by hand.
4. No shared or host credentials
- The agent’s container or job gets no credentials from your machine
(
~/.npmrc, cloud credentials, the Hugging Face token, SSH keys,docker.sock) and no publish-scoped registry token. - Parallel agent runs share no writable volume or cache.
sandbox-host-credentials and sandbox-shared-writable
(planned). Inline secrets in MCP configs and pre-approved reads of credential
files are already checked by mcp-inline-secret and
permission-credential-read.
5. Bound every run
- Every agent run has a limit on steps, time or cost, and a loop that restarts the agent has a limit too.
harness-unbounded (planned).
6. Keep a record the agent cannot edit
- Logs, transcripts and results are written somewhere the agent can append to but not rewrite.
7. Name a human to tell
- The instructions say who to report to, and someone reads the alerts and transcripts while the agent runs.
What this page does not cover
- It is about the harness around your agent, not about which model you use.
- The planned checks read files in your repository. They cannot see network policy, cloud IAM or runner settings that live outside it, so a clean result on items 1, 4 and 5 is not proof.
- It is written for a developer or a small team running agents on their own code. It is not a guide to securing a lab’s training or evaluation cluster.