Emergency Lockdown Policy Template

Instantly halt all AI agent API access with a single command or API call. The emergency lockdown policy gives you a kill switch that blocks every request at the proxy level — no agent can reach any LLM provider until the lockdown is lifted. Essential for incident response when an agent is behaving unexpectedly.

What this prevents

A security team detected that an AI agent's API key had been exposed in a public GitHub repository. The agent had access to GPT-4o with a $500 monthly budget. Within minutes of discovering the leak, they needed to stop all requests from that key — but the agent was running in a Kubernetes pod that would take 10 minutes to redeploy. With Govyn's emergency lockdown, a single CLI command instantly blocked the compromised key at the proxy level, stopping the bleeding while the team rotated credentials and patched the deployment.

Policy template

Copy this into your govyn.yaml and adjust the values to match your requirements.

govyn.yaml
# Emergency lockdown: uncomment to activate
# global:
#   lockdown: true
#   lockdown_message: "All agent access suspended. Contact ops@govynai.com."

# Or lock down specific agents:
agents:
  compromised_agent:
    lockdown: true
    lockdown_message: "This agent has been suspended pending investigation."
  healthy_agent:
    budget:
      daily: $5.00
    models:
      allow: [gpt-4o-mini]

# Activate via CLI:
# govyn lockdown --all
# govyn lockdown --agent compromised_agent
# govyn unlock --all

How it works

1

Incident detected

Your monitoring, alerts, or team identifies an issue — runaway costs, compromised credentials, unexpected agent behavior, or a security incident.

2

Execute the lockdown command

Run 'govyn lockdown --all' to block every agent, or 'govyn lockdown --agent [name]' to lock down a specific agent. The command takes effect immediately — no restart needed.

3

All matching requests are blocked

Govyn returns a 503 with your configured lockdown message for every blocked request. No traffic reaches any LLM provider. Logs continue to record the blocked attempts for forensics.

4

Investigate and resolve

With the immediate risk contained, your team can investigate the root cause, rotate credentials, fix the agent code, or take whatever corrective action is needed.

5

Lift the lockdown

Run 'govyn unlock --all' or 'govyn unlock --agent [name]' to restore access. Normal policy enforcement resumes immediately.

Configuration options

Option Description Example
global.lockdown Block all agents when set to true true
global.lockdown_message Custom error message during global lockdown All agent access suspended.
agents.*.lockdown Block a specific agent when set to true true
CLI: govyn lockdown Activate lockdown without editing YAML govyn lockdown --all

Add this policy to your config

Start Govyn with this policy in under 5 minutes. No code changes needed.

Get started

Related policy templates

Explore more