I’m Denis Shokhirev, an Agentic AI Systems Architect based in Freiburg im Breisgau, Germany, and my day-to-day stack is Claude, Supabase, n8n, Doppler, and self-hosted Postgres. The painful moment is not when an agent opens a pull request and leaves a polished summary; it is when that same path reaches production, a security hole is discovered, and nobody can state clearly who accepted the risk.
That is the real issue with autonomous coding agents in production. The conversation usually stays at code quality, token cost, and how fast the system can ship. But once an agent can generate code, comment on diffs, and influence merge or release decisions, the hard question is governance: who is accountable when the code passes CI, reaches prod, and still creates a real incident?
The mistake is treating automation as responsibility transfer
Claude Code and similar workflows can absolutely reduce repetitive engineering work. They can draft handlers, tests, SQL migrations, and internal docs faster than a human under time pressure. What they do not do is absorb accountability. If an agent writes an insecure database access layer, widens a Supabase policy too far, or leaves a secret in a repository, the liability does not disappear into the model.
OWASP’s Top 10 for 2021 lists Broken Access Control as the number one web application security risk: OWASP Top 10 2021. That matters here because the most dangerous agent-written mistakes are often not obvious exploits. They show up as “temporary admin route,” “internal-only helper,” “debug bypass,” or “quick migration script.” On three recent agent deployments I reviewed, the repeated issue was not spectacular malware-style code. It was ordinary-looking code with unsafe trust assumptions.
An agent approval is not the same as a review decision
A real PR review serves at least three functions: correctness, risk assessment, and an auditable record of who accepted the change. Automation can help with the first. It can partially help with the second. It usually fails the third unless you design for it deliberately. If your repository shows a bot approval, your CI is green, and your release workflow in n8n auto-promotes after checks pass, you may have a functioning pipeline but a weak accountability chain.
Where accountability breaks in real systems
In practice, the failure is rarely “the model wrote bad syntax.” The failure happens at the seams. The agent modifies a Postgres query, updates a Supabase Row Level Security policy, opens a PR, semgrep finds nothing, tests pass, and the change gets merged. Later, a cross-tenant read becomes possible because the business rule was never encoded as a testable invariant.
| Stage | What the agent does | Typical failure | Human owner |
|---|---|---|---|
| Code generation | Writes handlers, migrations, tests | Unsafe pattern enters the diff | Change requester |
| Static analysis | Runs semgrep, bandit, gitleaks | Rule set misses business logic risk | CI policy owner |
| Review | Summarizes and suggests approval | No named person signs off risk | Engineer or tech lead |
| Release | Triggers n8n workflow | Prod enablement happens automatically | Release owner |
| Runtime | Observes and proposes fixes | Issue discovered after data exposure | On-call owner |
If you automate the steps but never bind ownership to each artifact, you have convenience, not governance. That distinction becomes painful as soon as auditors, legal, or enterprise customers ask for incident traceability.
My production rule: automate actions, never automate ambiguity
I do not block agents from writing code or preparing pull requests. I block systems from hiding who accepted production risk. That leads to a simple design rule: every sensitive path needs a named human owner, even if the implementation work was agent-assisted.
1. Require a risk owner for sensitive changes
Authentication, billing, secret handling, access control, and infrastructure permission changes should not reach release on bot enthusiasm alone. They need a named reviewer or approver tied to the change record.
name: pr-guard
on: [pull_request]
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: returntocorp/semgrep-action@v1
- run: pip install bandit
- run: bandit -r app -ll
- uses: gitleaks/gitleaks-action@v2
- run: test -f RISK_OWNER || (echo "Missing RISK_OWNER" && exit 1)The file can be simple. What matters is that the pipeline refuses to normalize anonymous risk acceptance.
2. Policies matter more than prompt quality
A polished prompt saying “follow best practices” is not a control. CI checks are controls. If your policy blocks raw string-built SQL, disabled TLS verification, committed secrets, or dangerous subprocess usage, the system remains stable even when generated code looks plausible.
#!/usr/bin/env bash
set -euo pipefail
semgrep --config=p/owasp-top-ten .
bandit -r . -ll
gitleaks detect --no-banner --redact
if grep -R "verify=False" -n .; then
echo "TLS verification disabled"
exit 1
fi3. Add runtime checks for business invariants
Static analysis will not tell you whether tenant A can see tenant B’s invoice. That needs integration tests and runtime assertions. For Supabase and Postgres, I prefer testing Row Level Security directly instead of assuming the application layer gets everything right.
import os
import psycopg
dsn = os.environ["DATABASE_URL"]
with psycopg.connect(dsn) as conn:
with conn.cursor() as cur:
cur.execute("set local request.jwt.claim.sub = 'user_a'")
cur.execute("select count(*) from invoices where tenant_id = 'tenant_b'")
rows = cur.fetchone()[0]
assert rows == 0, "RLS violation: cross-tenant read"Use vendor guidance correctly
Anthropic’s documentation for Claude and tool use is clear about a basic point: the model acts inside the permissions and workflows the operator gives it; responsibility for tool access and execution boundaries sits with the system designer, not the model itself. See docs.anthropic.com. That is exactly why “the AI approved it” is not a serious production answer.
The policy I expect around agent-written PRs usually answers five questions:
- Which directories can the agent modify without manual review?
- Which change classes always require a named reviewer?
- Which checks are mandatory before merge?
- Who can authorize release to production?
- What rollback path exists without writing new code?
If your answer to any of those is “we usually handle it case by case,” then your accountability model is still informal. Informal models fail first in regulated or enterprise environments, but they also fail in startups the moment one real customer incident lands.
FAQ
Can an agent approve pull requests at all?
Technically yes, and that can be useful as a signal. I would still treat it as advisory, not as a final decision for sensitive code paths.
Do semgrep, bandit, and gitleaks solve most of the risk?
They solve known classes of problems very well. They do not understand your business-level access rules, contractual boundaries, or customer-specific data isolation requirements.
If the agent wrote the code, who owns the incident?
The owner is not the model. The owner is the person or role that controlled the merge path, release decision, and governing policy around that change.
Is human review still necessary if the runtime is sandboxed?
Yes for high-impact changes. Sandboxing reduces blast radius, but it does not replace contextual judgment about permissions, trust boundaries, or compliance exposure.
Does this only apply to large teams?
No. Smaller teams often need it more because accountability tends to stay tribal and undocumented until the first serious failure.
If your agent already writes pull requests or can influence releases, where in your LLM pipeline is risk acceptance actually recorded today: static analysis, runtime sandboxing, or a named human review step? I’d genuinely like to know.
I run a free 30-minute stack audit for DACH founders building AI in regulated markets. DM me on LinkedIn or write to @ger_dennis_ai.
I build agents like this for businesses in Germany and the EU.
Tell me in two sentences what eats your team’s time – reply within 24 hours.
Turn your process into an AI system
Production quality. DACH B2B focus.