Skip to content
any idea. anything possible.
Blog

Governance for AI coding agents: budgets, approvals, leases.

An agent that writes code needs the same governance as a new hire: a budget, an approval for risky decisions and no permanent key to the vault. This is how we implement it.

· 7 min read · ANYMATTER Team

In preparation

An AI coding agent is not a tool like a compiler. It makes decisions: which file to change, which command to run, which service to call. It does so quickly, often and without fatigue. That is its strength – and the reason it needs rules that do not appeal to its good will but are enforced technically.

At ANYMATTER we built three mechanisms that together form a governance model. None of them is new; all three are familiar from managing human access. What is new is that they apply to an agent working in a development environment. All three are built and tested but not yet released to customers – status “in preparation”.

1. Budgets: the agent has an account, not a cornucopia

Every AI call costs money – tokens at the provider, converted to euros. Without a limit, an agent stuck in a loop can burn a team’s monthly budget in one night. That is why at ANYMATTER every organization has a budget, optionally refined per project and per user.

A budget has two thresholds. At the warning threshold (a percentage of the monthly amount) an e-mail and a portal notice go to the people responsible; an event ai.budget.warning is also emitted, which can be subscribed to via webhook. At the hard stop the issue of new AI access tokens is blocked. The agent gets no more answers – until an owner or admin raises the budget or the month changes.

What matters is what the stop does not do: it stops no backups, no deployments, no security processes. It affects billable tokens only. And for usage with your own access, such as Claude Code with your developers’ subscription, it is informational only – we bill nothing there and consequently block nothing.

2. Approvals: risk decides, not convenience

Not every action is equally dangerous. Writing code on a branch, running tests, building an image – an agent may do that without asking. A deployment to production, a rollback, a database migration in production – it must not decide that alone.

That is why every action in ANYMATTER has a fixed risk level, and every risk level a default decision:

RiskExamplesDecision
LOWwrite code, tests, review, build imageallowed
MEDIUMdeployment to the preview slotallowed, can be tightened per organization
HIGHproduction deployment, rollback, production migration, create cloud resource, exceed budgetapproval by owner or admin
CRITICALdelete production data, change billingapproval by owner only, four-eyes principle
FORBIDDENexport secretsdenied, never overridable

Organizations can tighten decisions but not loosen them below the platform floor: HIGH always requires an approval, only the approver roles are selectable. CRITICAL requires an owner who re-authenticates and is not the requester. A low-risk write action that would take place in the production environment is automatically escalated to HIGH.

An approval is an object with a lifecycle: requested, approved, denied, expired. After seven days without a decision it expires, and whatever it was supposed to release stays in the safe state – a deployment remains a candidate, an agent job ends in a controlled way.

3. Leases: no permanent key

The third mechanism is the quietest and perhaps the most important. An agent needs credentials: for a database, for an API such as the schnelleStelle API, for a mail service. The naive solution is a .env file in the project directory. It is permanent, copyable and, with a bit of bad luck, ends up in the repository.

At ANYMATTER the agent receives secrets only as a lease: the platform writes the values into a file readable only by the respective Linux user, with an expiry time. Every issue is an audit event with the names and number of secrets – never with values. And the agent receives development environment secrets only. Production credentials do not exist for it; even a developer with full access to the development environment cannot read them.

On top of that is a rule we deliberately made immutable: exporting secret values is forbidden for every actor, including owners, including via the API, including platform staff under support access. Secrets go in and get used, but they never come back out as plain text.

Why all three belong together

Each mechanism on its own has a hole. Budgets without approvals: the agent can do damage within its budget. Approvals without leases: an approved step has access to everything. Leases without budgets: the agent runs safely but expensively.

Together they form a model humans have known for decades: a new employee gets a budget, has to get a signature for big decisions and receives a key that no longer fits after hours. None of this offends them. It makes them able to work without the organization having to trust them blindly.

And the audit log?

All three mechanisms write to the same audit log: policy decisions, approvals, budget events, secret issues. The entries are linked as a hash chain; a later modification would break the chain. The log never contains secret values, never prompts, never agent responses. It contains who decided what and when – and that is exactly what an audit needs.

What we are not building: autonomous agent teams that hand each other tasks and deploy without humans. We had built an orchestrator for that and deliberately switched it off. Not because the technology is missing, but because the governance for it is not yet mature. One agent, one human who approves – that is where we start.

  • #AI agents
  • #Governance
  • #Security