Skip to content

Developer agents

How to Control AI Coding Agents Before They Push Code or Deploy to Production

AI coding agents can safely automate reversible work such as drafting code, running tests, and preparing patches. A stronger authorization boundary is needed before consequential actions such as protected-branch pushes, production deployments, infrastructure changes, secret rotation, or production database migrations.

BobSentry evaluates the intended action before it executes and returns ALLOW, REQUIRE_APPROVAL, or BLOCK, then preserves signed decision evidence. Permissions still answer what an agent can access. BobSentry answers whether this specific action should execute now.

By Ashraf MPublished July 25, 202612 min read
AI coding-agent action passing through a runtime authorization boundary before Git push or production deployment.

Concrete coding-agent scenario

Consider an agent that fixes a runtime error, edits code, runs tests, prepares a commit, and then attempts a protected-branch push or production deployment. That last step is where runtime authorization belongs.

  1. AI coding agent fixes a runtime error
  2. Edits code and runs tests
  3. Prepares a commit
  4. Attempts protected-branch push or production deployment
  5. BobSentry evaluates the action
  6. ALLOW / REQUIRE_APPROVAL / BLOCK
  7. The command proceeds, waits for authorization, or stops
  8. Signed decision evidence is created

Example action names you can model include code.commit, git.push, git.force_push, deployment.preview, deployment.production, database.migration.production, infrastructure.apply, security_controls.disable, and secrets.rotate.

Where authorization sits

The authorization boundary must appear before the external system changes—before the push, deploy, migration, or apply runs. Editor guidance alone is not that boundary.

Execution boundary diagram showing authorization before downstream execution and separate evidence retention.
  1. 01
    Agent proposes action
  2. 02
    BobSentry evaluates
  3. 03
    ALLOW / REQUIRE_APPROVAL / BLOCK
  4. 04
    Approval resolution if required
  5. 05
    Downstream action may proceed
  6. 06
    Execution outcome recorded separately
  7. 07
    Signed decision evidence retained

Authorization is evaluated before the downstream system changes. Evidence records the decision; it does not authorize execution by itself.

Learn the product model on Product and the broader definition on What is BobSentry?.

Illustrative decision patterns

These are example policy patterns for discussion, not universal defaults for every organization.

Illustrative coding-agent policy patterns — not universal defaults
ActionContextSuggested decision
code.commitDevelopment branchALLOW
git.pushFeature branch, tests passedALLOW
git.pushProtected main or release branchREQUIRE_APPROVAL
git.force_pushProtected branch, any environmentBLOCK
deployment.previewNon-productionALLOW
deployment.productionCustomer-impactingREQUIRE_APPROVAL
database.migration.productionIrreversible or high-riskREQUIRE_APPROVAL or BLOCK
security_controls.disableAny environmentBLOCK

Metadata-only evaluate example

Send normalized action metadata. Do not include source-code contents, complete diffs, .env files, secrets, access tokens, customer records, or unfiltered terminal output.

CONCEPTUAL ACTION SCHEMAProduction deploy evaluate (illustrative)
{
  "agent_id": "coding-agent-bobsentry-dev",
  "action": "deployment.production",
  "target": "bobsentry-production",
  "context": {
    "repository": "bobsentry",
    "branch": "main",
    "tests_passed": true,
    "protected_branch": true,
    "environment": "production",
    "change_risk": "high"
  }
}

For a sandbox walkthrough, see Developers. Coding-agent scope patterns are also described on Dev Guard.

Practical enforcement patterns

BobSentry does not currently ship an official Cursor integration, Git hook package, deployment gate, MCP gateway, or native IDE interception. Harder enforcement belongs in infrastructure you control.

A practical enforcement pattern is to place the BobSentry authorization check in a Git pre-push hook, CI required check, deployment wrapper, infrastructure pipeline, or protected tool gateway.

What BobSentry does and does not prove

BobSentry authorizes whether an action may proceed and can preserve signed decision evidence for the requested action, policy evaluation, decision outcome, and authorization state.

BobSentry does not prove that Git accepted the push, that the deployment finished successfully, or that the downstream system applied the change. Record execution outcomes separately.

For the metadata boundary and evidence model, see Security.

Failure-mode considerations

Decide explicitly how the integration behaves on timeout, evaluate errors, queued approval, or missing approvers. Fail-open may suit low-risk internal automation. Production deploys and destructive migrations usually need stricter fail-closed behavior. There is no single correct mode for every action class.

FAQ

Can BobSentry stop an AI coding agent from deploying production?

BobSentry can return BLOCK or REQUIRE_APPROVAL for a production deployment action when your integration sends that action for evaluation before execution. Enforcement depends on placing the evaluate call on the path that would otherwise run the deploy.

Where should the authorization check sit?

At the last reliable control point before the consequential command runs—commonly a Git pre-push hook, CI required check, deployment wrapper, infrastructure pipeline step, or protected tool gateway.

Is a Cursor rule sufficient enforcement?

Project rules and prompts can guide an agent, but they are not a hard execution boundary. Treat them as guidance. Pair consequential actions with an authorization check in infrastructure you control.

Should every code edit require approval?

Usually no. Humans should approve the actions that matter—protected-branch pushes, production deploys, destructive commands—not every local edit or test run.

What happens if BobSentry is unavailable?

Your integration defines fail-open or fail-closed behavior. For production deployments and destructive changes, teams often prefer fail-closed. There is no universal correct mode for every action.

Does an approved deployment decision mean deployment succeeded?

No. Approval means the action is authorized to proceed. Downstream success or failure must be recorded by the deployment system or integration separately.

Does BobSentry need to receive source code?

No. Evaluate requests should carry normalized action metadata. Keep source contents, full diffs, secrets, tokens, and unfiltered terminal output out of the request.

Can the same pattern work with CI/CD?

Yes. A practical enforcement pattern is to call BobSentry from a required CI check or deploy wrapper before the production apply step runs.