Skip to content
PKResources
Course outline

The CTO's playbook for AI coding agents · Module 4: Guardrails and governance

Permissions, sandboxes and secrets at org level

Individual engineers can configure guardrails. Only the org can make them the default. Define tiers of autonomy, ship managed settings, and keep secrets and egress out of reach.

Lesson 14 / 20 · ⏱ 8 min

Every agent tool has a permissions screen. Left to each engineer, you get a hundred different configurations, and the riskiest one sets your exposure. The org’s job is not to configure agents for people. It’s to decide the defaults, ship them centrally, and make the safe path the easy one.

Tiers of autonomy

Stop debating “should agents be allowed to run commands?” in the abstract. Define a small ladder, attach controls to each rung, and let teams climb it when they meet the bar.

  1. 1

    Default

    Tier 1 · Suggest

    The agent proposes code or commands; a human applies every change. Allowed everywhere, including sensitive repos.

  2. 2

    Most teams

    Tier 2 · Edit with approval

    The agent edits files and runs an allowlist of safe commands. Anything else prompts the developer.

  3. 3

    Approved use cases

    Tier 3 · Autonomous in a sandbox

    Runs unattended in a container or VM: no host access, egress allowlist, test credentials only. Output is a branch, never a deploy.

  4. 4

    Platform-owned

    Tier 4 · Autonomous in CI

    Triggered by events, with a short-lived, narrowly scoped token. Everything it produces goes through normal review and branch protection.

The rule that makes the ladder work: autonomy goes up only when blast radius goes down. A team gets tier 3 by proving the sandbox, not by asking nicely.

Control Tier 1 Tier 2 Tier 3 Tier 4
Who approves actions Human, every change Human, outside allowlist Policy, then PR review Policy, then PR review
File system None Repo only Disposable workspace Ephemeral runner
Network n/a Developer’s own Allowlisted hosts Allowlisted hosts
Secrets None None in agent env Test credentials Short-lived, scoped token
Who owns the config Vendor default Managed settings Platform team Platform team

Default-deny, managed centrally

Most agent tools support a settings file or admin policy that the user can’t override. Use it. A managed baseline is to agents what a hardened base image is to servers.

✕ Per-engineer config

  • –Everyone tunes their own allowlist, nobody audits it
  • –Approvals get switched off to stop the prompts
  • –New hires inherit whatever the last person shared
  • –You learn the real config during an incident

✓ Managed baseline

  • +Deny by default: push, deploy, delete outside repo, raw network
  • +Allow the boring: read, search, test, lint, build
  • +Teams can add to the allowlist through a reviewed PR
  • +Config lives in a repo, so changes have history and owners

Secrets and egress

Assume anything in the agent’s reach can leave. Two controls do most of the work.

  • Secrets out of reach. No production credentials on developer machines where agents run, no long-lived tokens in CI. Use short-lived, least-privilege credentials issued per job, and keep a secret scanner on every push.
  • Egress allowlist. Sandboxed and CI agents talk only to the model endpoint, your package proxy and your source host. That single rule kills most exfiltration paths and closes the hallucinated-package hole when the proxy only serves vetted sources.

Check your defaults

🧠 Org-level guardrails

Score: 0 / 4

  1. 1. A team wants their agent to run unattended overnight. What should unlock that?

  2. 2. Why ship managed settings instead of a wiki page of recommended config?

  3. 3. Which single control blocks the most exfiltration paths for a CI agent?

  4. 4. A CI agent only comments on PRs. Its token can push to main. What's the fix?

For hands-on setup your engineers can follow, see Guardrails: permissions, sandboxes and secrets and Headless agents in CI.

Before you move on

✅ Key takeaways

0 / 5 completed