Patterns · working with agents

Who may do what.

Who holds which key, and what can an agent do without asking? Each kind of actor holds one narrow credential. Gates check it, and anything beyond it stops until I say yes. An agent that is refused never looks for another way in.

The flow

Trust model: what an agent may do on another machine, and what stops it Three lanes. An agent needs to act on another machine. Two gates check it: the limits on the key it holds, then the deploy gate's forced command. The agent acts only inside that grant. Pull request checks gate its code, and sensitive changes wait for me. If a gate refuses or the password manager is locked, the agent stops and asks, I approve, and the agent retries once. refused allowed sensitive: waits asks retry once 1 Needs access another machine 2 Key limits narrow, scoped 3 Deploy gate forced command 4 Agent acts inside the grant 5 PR checks sensitive paths 6 I review the reserved list 7 Stops, asks no other route 8 I approve then retry once I DECIDE AN AGENT ACTS A GATE CHECKS
  • I decide
  • An agent acts
  • A gate checks

Numbers match the steps below.

Steps

  1. An agentNeeds to act on another machine

    Deploy a service, pull a repository, use a secret. The agent does not pick a route. It uses the one credential it holds.

  2. The keyLimits what the key can do

    Agents reach other machines with standing keys, each limited to addresses on the private network and stripped of everything but a command channel. Hosts that only pull code hold one read-only deploy key per repository, so a leaked key can read one thing and write nothing. Secrets are read through a password manager only, never from the operating system’s keychain, chat or files.

  3. The deploy gateRuns one forced command

    The receiving end of the deploy key runs one fixed script whatever the client asks for. It accepts only a status check or a deploy, for a short allow-list of services. There is no shell, no terminal and no forwarding. The edge and the platform’s own configuration are refused by name, and every call is logged.

  4. An agentActs inside that grant

    A deploy fast-forwards the main branch and nothing else. Code reaches that branch by pull request and auto-merge, never by a direct push. The agent’s source-control token has no administration permission, so it cannot lift branch protection.

  5. Pull request checksHold sensitive changes

    CI must be green. A separate check blocks auto-merge on changes to CI workflows, SSH or sudo handling, network exposure, the deploy gate and the edge configuration, until a label is applied that only I apply.

  6. MeReview what is reserved for me

    Applying that label, edge deploys, deploys that need root, waivers, security code fixes, major version bumps, anything touching auth or data, and every permanent delete. The account-level powers, such as network policy, DNS, the router and the account key, stay with me alone.

  7. An agentStops and asks, never reroutes

    A refused command, or a connection that hangs and then fails authentication because the password manager is locked, ends the attempt. The agent does not switch to another protocol, the keychain or another key. It reports state and side effects. After two failures of one automation it hands over the manual steps.

  8. MeApprove, then the agent retries once

    I unlock the password manager, or do the step myself. My own key asks for a prompt on every use, so nothing I hold can be used silently.

Guardrails

What stops it

Hard stops

  • The deploy key runs one forced command, with every extra feature off, and works only from the private network.
  • Read-only deploy keys cannot push.
  • Required checks block auto-merge on sensitive changes.

What waits for me

My call

  • The label that releases sensitive changes, edge and root deploys, waivers.
  • Every permanent delete: the exact command is parked for me to run.
  • Each use of my own key: a prompt on every use.

What happens on failure

Stop, ask, retry once

  • A connection that hangs, then fails authentication, means the password manager is locked: ask me, retry once, never switch route.
  • A refused gate command exits with an error, and a failed deploy is fixed by a revert, then a new deploy.
  • Two failures of one automation: stop and hand over the manual steps.

Who holds what

Each kind of actor holds one narrow credential. I hold a personal key that prompts on every use and reaches everything I own. Agent sessions on my workstation hold standing keys that reach the other machines on the private network and nothing else; they cannot touch the account-level powers. Unattended jobs hold a scoped source-control token and the deploy key, which can run a status check or a deploy of a few named services and nothing more. Hosts that only pull hold one read-only key per repository.

One boundary is worth naming plainly: the sensitive-change label is a rule agents follow, not an identity check, which is why it stays mine.

The idea

Give every actor the smallest credential that does its job, and put a gate on the receiving end, not just a promise on the sending end. A key that can run only one command cannot be talked into anything else. Then make the failure mode boring: when a gate says no, the agent stops and asks, because an agent that hunts for another route is the real risk. What remains for the human is short and explicit, so the list of things only I can do stays small enough to keep.

Copied