Architecture portfolio

ADR 009

The AI coding agent runs with least privilege

AcceptedNovember 2026Scope: engineering process, AI governance

Context

Much of this platform was built with an AI coding agent (Claude Code), often directed from a phone. AI agents are productive, but they make mistakes, and their behaviour can be steered by text they read in files, web pages or tool output (prompt injection). An agent with root on a production server is a single bad instruction away from an outage or a data leak.

Options considered

OptionForAgainst
Agent runs as rootCan fix anything immediatelyUnbounded blast radius; no review step; the agent could read every secret
No agent on the server; work only on a laptopSafeLoses most of the speed; can't check live logs or health
Unprivileged user; changes reach production only through Git and the normal pipelineEvery change is a commit; production apps are read-only to the agent; sudo is limited to two audited scriptsSome tasks (root clean-ups, protected apps) need the human

Decision

Consequences

At bank scale

This is the pattern I'd propose for rolling out AI coding agents in a regulated enterprise:

Treat the agent like a fast, capable contractor on day one: productive, supervised and unable to touch production on its own.