Deployment Approval Agent

An AI agent reviews each deployment request, gathers context with tool calls and scores the risk. A deterministic policy then auto-approves it, rejects it, or pauses it for a human. The model can raise the bar for approval, but it can never lower it.

How a request flows

1 · Request

Persisted, then queued

The request and its first job are written in one transaction. A worker claims jobs with SKIP LOCKED, so a restart never loses one.

2 · Context

Tool calls

The diff (and which payments, auth or migration files it touches), test results, incidents in the last 30 days, and the service tier.

3 · Assess

The LLM advises

Gemini or Ollama returns a risk score, level, reasons and confidence as validated JSON. Timeouts, 429s and bad output fall back to a rule-based assessor.

4 · Decide

Rules decide

Failing tests reject. Tier-1 production, high risk, low confidence or a Friday-evening deploy wait for a human. Everything else auto-approves.

Engineering highlights

Never less strict than the rules

Every LLM assessment is merged with a rule-based baseline: the higher risk and the lower confidence win.

A persisted state machine

Every state is stored in Postgres, illegal transitions are rejected in code, and pending work resumes on startup. A timed-out approval escalates; it never auto-approves.

Append-only audit trail

Tool calls, raw model output, fallbacks, policy decisions and human actions are recorded in a table that a database trigger keeps append-only.

Built for free tiers

It runs in 512 MB on Render with Neon Postgres. The health check never touches the database, and a CDS archive shortens cold starts.

Measured

40 / 40eval scenarios matching the expected outcome (rule-based, in CI)
0false approvals: risky deploys that were auto-approved
144 MiBresident memory after loading the demo, of a 512 MB limit
~35 scold start at 0.1 CPU, down from ~47 s without the CDS archive

Try the demo scenarios

In the demo, click Load demo scenarios, then open one. You can approve, reject, or ask the agent a question, which re-runs the assessment.

ScenarioWhat it showsOutcome
Docs typo fixA small, green change to a tier-3 serviceAuto-approve
Risky payments change400+ lines of payments code and a schema migration, after a recent incidentNeeds a human
Failing testsA red CI run is rejected before anyone looksReject
Tier-1 productionA trivial UI change, but to a tier-1 service in productionNeeds a human
Low confidenceA broad refactor with thin evidenceNeeds a human
Friday eveningAn otherwise safe deploy inside the freeze windowNeeds a human