Agent Job Governance Gate
Seven sequential checks between an agent job being scheduled and it being allowed to run, each producing an audited allow, deny or degrade with a machine-readable reason.
Runtime state: The gate is wired and has emitted several hundred audited events, and its policy rows are live at the strictest settings. But no job-level allow or deny has been recorded, because the runtime the gate protects is switched off by an unset environment flag — the guard is in place ahead of the thing it guards.
- Business objective
- Make what an agent is permitted to do a deterministic lookup rather than a matter of trust, and make autonomy something a capability earns rather than something it is granted.
- Trigger
- An agent job is about to execute.
- Inputs
- The job's capability key, queue and requested mode
- The effective policy for the narrowest matching scope
- Current running-job count and recent decision count
- Verification and canary results, for autofix requests only
- Outputs
- An allow, deny or degrade decision with a machine-readable reason
- An audited decision row and an event row
- A rollout advance, or a rollback
One entry point, seven checks
Every agent job passes through a single function before it executes. That matters more than the checks themselves: one entry point means there is no second path where a check can be forgotten.
The checks run in order, and the order is deliberate — cheapest and most absolute first, most expensive last.
Job to allow, deny or degrade
Ordered so that a blanket stop costs nothing to evaluate and an expensive verification only runs when everything else has passed.
- Approval gate
1 — Kill switch
Decision point: Engaged for this scope? Deny. One switch, no negotiation, evaluated first because it is the cheapest possible answer.
- Approval gate
2 — Phase compatibility
Decision point: Autonomy is ordered: observe is below assist, which is below autofix. A job may not request a mode above the phase its scope has reached. This is what makes escalation gradual rather than binary.
- Approval gate
3 — Allowlist
Decision point: An explicit per-capability, per-phase allow or deny. The escape hatch for 'this specific thing, never'.
- Approval gate
4 — Concurrency
Decision point: Running jobs in this scope at or above the ceiling? Deny. Bounds blast radius rather than cost.
- Approval gate
5 — Hourly rate
Decision point: Decisions in the trailing hour at or above the ceiling? Deny. This is the check that makes a per-job budget mean something — a bounded job rescheduled immediately is an unbounded job in installments.
- Approval gate
6 — Verification, autofix only
Decision point: A pluggable pre-check must return true. Skipped entirely for observe and assist, because the cost is only justified when something is about to change.
- Approval gate
7 — Canary, autofix only
Decision point: The experiment canary must be green. A regression in the canary blocks the autofix.
- Data store
Audit the decision
Every check writes a decision row and an event row with a machine-readable reason. Audit failure never fails the gate open — the gate's own logging cannot become a denial-of-service against it.
- Monitoring / feedback
Rollout advance
Decision point: On a fixed cycle, a capability moves from one phase toward the next through a canary window, with automatic rollback and a recorded reason if it regresses.
- Data store
- Approval gate
- Monitoring / feedback
Scoped policy, resolved narrowest-first
A policy is not global-or-nothing. Three scopes exist — global, per-queue, and per-capability — and the effective policy is the narrowest one that matches. So the fleet can sit at observe while one well-understood capability runs at autofix, without weakening anything else.
The live policy rows are worth quoting because they show the intent: the two capabilities that have reached autofix are pinned to a concurrency of one, ten runs per hour, and both verification and canary required.
Decision points
- Is anything blanket-stopped? The kill switch, first.
- Has this capability earned the mode it is asking for? Phase compatibility.
- Is there capacity, and has it run too often? Concurrency and rate, separately — they bound different things.
- For autofix only: does it verify, and is the canary clean?
- Should this capability advance a phase, or roll back?
Responsibilities
AI / LLM
- Nothing. No model participates in any of the seven checks.
Deterministic
- All seven checks.
- Scoped policy resolution.
- Concurrency and rate counting.
- Rollout advance, canary windowing and rollback.
- Decision and event auditing.
- Risk classification by mode.
Human approval points
- Setting policy per scope, and the ceilings within it.
- Approving an autofix run — required by default, and re-verified on resumption rather than trusted from the first check.
- Advancing a phase, on the evidence the lower mode produced.
- Engaging or releasing the kill switch.
Failure handling
| Failure | Response |
|---|---|
| Policy store unreachable | Deny. An outage must not become an authorization bypass. |
| Audit write fails | The gate still returns its decision. Logging is best-effort so that it cannot block the thing it observes. |
| A capability regresses after promotion | The rollout rolls it back automatically and records the reason. |
| Workflow risk score too high | Auto-disabled, and the orchestrator refuses it before starting. |
| Approval requested but never given | The run stays parked. There is no timeout into execution. |
| Rate ceiling reached by legitimate load | Denied, and the denial is visible. Deliberate: a ceiling that yields under pressure is not a ceiling. |
Monitoring
Decisions by outcome and reason, denial rate per check, concurrency and rate ceilings hit, rollout phase per capability, rollback count with reasons, and approval queue age. The reason codes are the useful part — an aggregate denial count tells you nothing, but a spike in one reason tells you exactly which ceiling to look at.
Business value
This is what makes agents against production defensible. Every refusal has a stated reason, every escalation has evidence behind it, and a database outage denies rather than permits.
Related projects
Related workflows
- Agent Workflow Orchestration
Thirty-eight agent workflows declared as YAML capability graphs, each with ordered and parallel steps, an autonomy mode, a token budget and required evidence.
- Agent Finding Collection and Triage
Collect findings from diagnostic agents, collapse duplicates within a time window, and present distinct problems to an operator instead of the same problem stated fifteen ways.
- Incident Diagnosis and Approval
Read-only AI diagnosis during a production incident, with a human approving every action — because the fastest wrong fix is worse than a slower right one.