DevOps AI Agent Guardrails
DevOps AI agent security with shell command filtering, infrastructure authorization, coding agent guardrails, and deployment safety controls. Prevent unauthorized changes to production systems.
What are DevOps AI agent guardrails?
DevOps AI agent guardrails are runtime controls that authorize and monitor tool calls made by coding and infrastructure AI agents. They intercept shell commands, file operations, deployment actions, and infrastructure changes before execution, enforcing policies that protect production systems from unauthorized modifications.
Risks in DevOps AI agents
Coding agents and infrastructure automation tools have broad access to critical systems. Without authorization controls, a single misstep or hallucination can cause catastrophic damage. We've seen agents delete production databases after being told to stop, push broken code to main branches, and execute shell commands that compromise security.
Agents can execute arbitrary commands including rm -rf, curl pipes to bash, and privilege escalation.
Uncontrolled modifications to cloud resources, Kubernetes deployments, and database schemas.
Pushing untested code, bypassing CI/CD, and deploying to wrong environments without approval.
Real-world DevOps scenarios
Guardrails for the most common DevOps agent operations. Each scenario shows how Veto intercepts and authorizes actions before they execute.
Shell command filtering
Intercept all shell_exec tool calls and validate against a whitelist of allowed commands. Block dangerous patterns like recursive deletes, remote script execution, and system modifications.
File operation limits
Restrict file system access to approved directories. Block writes to configuration files, prevent deletion of critical paths, and require approval for modifications to production configs.
Deployment approvals
Require human approval for production deployments. Route deploy actions to Slack or email for review before execution. Prevent midnight deploys without oversight.
Container operations
Control Docker and Kubernetes operations. Block privileged container creation, prevent host path mounts, and restrict image pulls to approved registries.
Shell command policy example
Define authorization rules for shell commands. Block destructive patterns, allow safe operations, and require approval for sensitive actions.
policies:
# Block destructive commands entirely
- name: "Block destructive shell commands"
match:
tool: "shell_exec"
arguments:
command: "^(rm -rf|dd if=|mkfs|> /dev/sd).*$"
action: deny
response:
error: "Destructive commands are not permitted"
# Block remote script execution
- name: "Block curl pipe to bash"
match:
tool: "shell_exec"
arguments:
command: "(curl|wget).*\|.*(bash|sh)"
action: deny
response:
error: "Remote script execution is blocked for security"
# Require approval for sudo commands
- name: "Approve sudo commands"
match:
tool: "shell_exec"
arguments:
command: "^sudo .*"
action: require_approval
approval:
timeout_minutes: 15
channels: [slack]
# Allow safe commands
- name: "Allow read operations"
match:
tool: "shell_exec"
arguments:
command: "^(ls|cat|grep|find|head|tail|echo) .*"
action: allowFile path restrictions
Control which files agents can read, write, and delete. Protect sensitive configurations and prevent unauthorized modifications.
policies:
# Block access to system directories
- name: "Protect system paths"
match:
tool: ["read_file", "write_file", "delete_file"]
arguments:
path: "^/etc/.*|^/root/.*|^/home/.*\.ssh/.*"
action: deny
response:
error: "Access to system paths is not permitted"
# Block environment file modifications
- name: "Protect environment files"
match:
tool: ["write_file", "delete_file"]
arguments:
path: ".*\.env$|.*\.env\..*$"
action: deny
response:
error: "Environment file modifications require manual review"
# Require approval for production configs
- name: "Approve production config changes"
match:
tool: "write_file"
arguments:
path: ".*(prod|production).*\.(yaml|yml|json|toml)$"
action: require_approval
approval:
timeout_minutes: 30
channels: [slack, email]
# Allow project directory operations
- name: "Allow project access"
match:
tool: ["read_file", "write_file"]
arguments:
path: "^/workspace/.*"
action: allowCommon DevOps agent policies
Pre-built policy patterns for the most common DevOps agent scenarios. Adapt these rules to your infrastructure and security requirements.
Git branch protection
Block pushes to main/master branches. Require pull requests for all production changes. Prevent force pushes and history rewrites on protected branches.
Cloud resource guardrails
Block deletion of cloud resources. Require approval for creating expensive instances. Restrict modifications to networking and IAM configurations.
Database change control
Block DROP and TRUNCATE commands. Require approval for schema migrations. Log all database modifications for audit trails.
Secret management
Block operations on credential files. Prevent secret exposure in logs. Require approval for adding or modifying API keys and tokens.
Integration with coding agents
Veto integrates with popular coding agents and IDE tools. Protect your infrastructure while maintaining developer productivity.
Related resources
Frequently asked questions
What is DevOps AI agent security?
How do coding agent guardrails work?
Can guardrails prevent the rm -rf accidents?
Do guardrails work with MCP tools?
How do I handle deployment approvals?
Protect your infrastructure from autonomous agents.