Security Guarantees and Safety¶
Can Your Organization Use This Agent Securely?¶
YES - The agent is designed with enterprise security and safety as the top priority.
Security Guarantees¶
1. Secure by Design¶
Architecture Security:
- No external data exfiltration
- All operations logged and audited
- The six host-mutating tools require approval for live changes when
AUTO_APPLY=false; dry runs remain available. - Org credentials encrypted at rest when
ENCRYPT_CREDENTIALS=true+CREDENTIALS_MASTER_KEY(services/credential_crypto.py); otherwise plaintext JSON - API keys never logged
- Org config, docs and audit routes require a bearer token:
API_ADMIN_TOKEN(platform admin) orAPI_ORG_TOKENSwith roles (org=…,org:viewer=…,org:approver=…,org:admin=…). Hierarchy admin > approver > viewer. Fails closed with 503 when no token is configured (api/api_auth.py).
Code Security:
- No shell injection vulnerabilities
- Uses
shlex.split()for safe command execution - Input validation on all endpoints
- Optional rate limiting when
RATE_LIMIT_ENABLED=true(api/rate_limit.py); still recommend edge/LB limits for multi-worker - Security scanning in CI/CD pipeline
Network Security:
- TLS/SSL encryption for all communications
- Webhook authentication is checked when
WEBHOOK_SECRETis configured (webhook gate). - Optional IP allowlist via
ALLOWED_IPS(api/ip_allowlist.py); also filter at the load balancer when possible - Alertmanager and Grafana accept
WEBHOOK_SECRETas a bearer token or an HMAC signature (webhook handlers). - Optional VPN/bastion integration
2. Will It Be Hacked?¶
Multiple Security Layers:
Layer 1: Authentication
# Configure the shared webhook secret
WEBHOOK_SECRET=<strong-secret>
# Configure the separate Slack signing secret
SLACK_SIGNING_SECRET=<slack-signing-secret>
With WEBHOOK_SECRET set, webhook handlers check HMAC-SHA256 signatures or supported shared-token headers. Alertmanager and Grafana accept bearer tokens; GitLab accepts X-Gitlab-Token. These checks accept requests without authentication when the secret is unset (webhook gate, Alertmanager/Grafana handlers, GitLab handler, verification functions).
Slack actions verify Slack signatures and request timestamps when SLACK_SIGNING_SECRET is configured; the check accepts requests when that secret is unset (Slack handler, Slack verification).
The API logs a warning at startup for each of WEBHOOK_SECRET and SLACK_SIGNING_SECRET that is unset, so running without them is visible in the logs; requests are still accepted (startup check).
Layer 2: Authorization
Org config, docs and audit routes check a bearer token against API_ADMIN_TOKEN (every org, admin role) or API_ORG_TOKENS entries (org=token or org:role=token). Write routes require admin; read routes accept viewer+. A token for one org gets 403 on another; routes return 503 when no token is configured (api/api_auth.py). The MCP server's sse/streamable-http transports require MCP_AUTH_TOKEN, can be bound to one org with MCP_ORG_ID, and only expose configure_org_credentials with MCP_ALLOW_CREDENTIAL_WRITE=true (devops_mcp/auth.py). Keep deployment-level access controls in place as well.
Layer 3: Encryption
Org credentials are stored at {org_id}/config/credentials.json. With ENCRYPT_CREDENTIALS=true and CREDENTIALS_MASTER_KEY, the blob is Fernet-encrypted before write; otherwise plaintext JSON (migration: plaintext reads still work).
The agent itself serves plain HTTP; there is no TLS setting. Terminate TLS in front of it
(ingress, load balancer or reverse proxy), or start uvicorn directly with
--ssl-certfile / --ssl-keyfile.
Layer 4: Network Isolation
Deploy in private network
Access via VPN or bastion host
No direct internet exposure
Internal DNS only
Layer 5: Audit Trail
{
"timestamp": "2026-06-12T13:00:00Z",
"user": "agent",
"action": "restart_service",
"resource": "nginx",
"result": "success",
"ip": "10.0.1.5",
"signature": "verified"
}
3. Security Features¶
Built-in Security Controls:
Command Whitelisting:
# Only safe commands allowed
SAFE_COMMANDS = [
"systemctl restart",
"systemctl status",
"kubectl get",
"kubectl logs",
"nginx -t",
"apache2ctl configtest"
]
Command Blacklisting:
# Dangerous commands blocked forever
BLOCKED_PATTERNS = [
r"rm\s+-rf\s+/", # Recursive delete root
r"format\s+", # Format disk
r"mkfs\.", # Make filesystem
r"dd\s+if=", # Disk operations
r"DROP\s+DATABASE", # Drop database
r"TRUNCATE\s+TABLE", # Truncate table
r"DELETE\s+FROM.*WHERE\s+1" # Delete all rows
]
Real-time Security Scanning:
# Scans configurations for security issues
security_checks = [
"privileged_containers",
"exposed_secrets",
"unencrypted_http",
"weak_passwords",
"missing_rbac",
"open_ports"
]
Compliance Validation:
# Scanner configuration defaults
ENABLE_SECURITY_SCANNING=true
ENABLE_COMPLIANCE_CHECKS=true
COMPLIANCE_FRAMEWORKS=CIS
These are environment settings read by SecurityScanner. When scanning and compliance checks are enabled, COMPLIANCE_FRAMEWORKS selects CIS, SOC2/SOC-2, or PCI/PCI-DSS/PCIDSS text checks; other names are ignored (framework dispatch).
The scanner uses text matching for privileged-container flags, missing non-root settings, non-local HTTP URLs, possible embedded secrets, and long digit sequences resembling card data. Its CIS path also emits an allowPrivilegeEscalation finding; the current predicate retains a space in the search string after removing spaces from the input, so that finding is always emitted. These are advisory findings, not certification or a complete framework assessment (CIS checks, SOC2 checks, PCI checks).
Safety Guarantees¶
1. Will It Delete Anything?¶
NO - The agent NEVER deletes production data.
How this is enforced in the command executor (tools/executor.py):
- Permanently blocked, never run, not even with approval or
AUTO_APPLY=true:kubectl delete/drain,helm uninstall, recursive or rootrm,mkfs/wipefs, rawdd/redirects to block devices,DROP DATABASE/TABLE,TRUNCATE TABLE,DELETE FROM, AWS/GCP/Azure delete and terminate,terraform destroy, scaling to zero replicas, and Docker volume/system prune. A blocked command emails the team (whenEMAIL_ENABLED=true) and can only be run by a human, manually. - Always needs human approval, whatever
AUTO_APPLYsays:kubectl exec, single-filerm,kill -9,shutdown/reboot, and any command not on the safe or auto-apply lists.AUTO_APPLY=trueonly auto-runs the listed restarts, scales and applies. - Chained commands are checked part by part. In
a; b,a && banda || b, the most restrictive part wins. After a pipe, only read-only filters (grep,head,tail,wc,sort,jq, …) keep a command safe, and command substitution or redirection always needs approval. - Reading secret values needs approval.
kubectl get secret(s) … -o yaml|json|jsonpath|go-template|custom-columns(or--template) is never auto-run, even withAUTO_APPLY=true. Listing secret names (kubectl get secrets,-o name,-o wide) andkubectl describe secret(sizes only) stay automatic. - Secret values are redacted from all tool output before it reaches the LLM, Slack, logs or audit storage, including after an approved read. That covers Kubernetes Secret
data/stringData, and env values whose names containPASSWORD,SECRET,TOKEN,API_KEY,ACCESS_KEY,PRIVATE_KEYorCREDENTIAL(docker inspect,kubectl get pod -o yaml,printenv). Key names are kept so the agent can still tell whether a key exists.
What It Will NEVER Do:
PERMANENTLY BLOCKED OPERATIONS:
❌ Delete databases
❌ Drop tables
❌ Format disks
❌ Remove user data
❌ Delete production files
❌ Truncate tables
❌ Recursive delete on /
❌ Remove backups
❌ Delete logs (old logs only rotated)
❌ Remove git repositories
What It WILL Do (Safe Operations):
✅ Restart services (nginx, apache, etc.)
✅ Reload configurations
✅ Clear cache (Redis, application cache)
✅ Rotate logs (keeps last N days)
✅ Clean package cache (safe, can re-download)
✅ Remove temp files (/tmp, /var/tmp)
✅ Increase resource limits
✅ Fix file permissions
✅ Test configurations
✅ Collect diagnostics
Safety Mechanism:
# Before EVERY command
def execute_command(command):
# 1. Check if command is dangerous
if is_dangerous(command):
# Send email to SRE team
send_email(
subject="DANGEROUS OPERATION DETECTED",
body=f"Command blocked: {command}",
instructions="Manual steps: ..."
)
return "BLOCKED"
# 2. Dry-run first
result = dry_run(command)
if result.failed:
return "DRY_RUN_FAILED"
# 3. Execute safely
result = execute(command)
# 4. Document
generate_documentation()
return result
Fix verification is separate from per-command execution: the executor returns command status and output (executor). At normal agent completion, FixVerifier runs only when has_successful_remediation classifies an action as successful remediation (completion path, verification gate).
2. Email Before ANY Dangerous Action¶
Automatic Email Alerts:
TO: sre-team@company.com
SUBJECT: DANGEROUS OPERATION DETECTED - APPROVAL REQUIRED
A potentially dangerous operation was detected:
Operation: Delete old database backups
Command: rm -rf /backups/db-2024-*
Reason: Disk space full
Risk Level: HIGH
WHY THIS IS BLOCKED:
- Could delete recent backups
- No way to recover if wrong files deleted
- Should be reviewed by human
MANUAL STEPS:
1. Review backup retention policy
2. Check which backups are safe to delete:
ls -lh /backups/db-2024-* | head -20
3. Delete only confirmed old backups:
rm /backups/db-2024-01-*.tar.gz
4. Verify disk space:
df -h
VERIFICATION:
- Backup policy followed
- Recent backups intact
- Disk space recovered
DO NOT proceed without review!
Incident ID: INC-2026-001
Timestamp: 2026-06-12 13:00:00 UTC
3. Complete Audit Trail¶
Every Action is Logged:
{
"incident_id": "INC-2026-001",
"timestamp": "2026-06-12T13:00:00Z",
"alert": {
"source": "Prometheus",
"severity": "high",
"description": "Nginx 502 error"
},
"analysis": {
"root_cause": "PHP-FPM service stopped",
"affected_services": ["api", "frontend"],
"duration": "5 minutes"
},
"action": {
"type": "restart_service",
"command": "systemctl restart php-fpm",
"executed_at": "2026-06-12T13:00:30Z",
"executed_by": "devops-ai-agent",
"approved_by": "auto (safe operation)",
"result": "success"
},
"verification": {
"immediate_check": "passed",
"stability_monitoring": "passed",
"success_rate": "100%",
"duration": "5 minutes"
},
"documentation": {
"runbook": "docs/runbooks/nginx_502_20260612.md",
"postmortem": "docs/postmortems/INC-2026-001.md",
"kb_article": "docs/kb/nginx_upstream_failure.md"
}
}
Audit Log Storage:
Location: /var/log/devops-agent/audit.log
Retention: 90 days
Backup: Daily to S3/Cloud Storage
Access: Read-only except agent
Monitoring: SIEM integration
Fix Accuracy and Verification¶
Will the Fixes Be Accurate?¶
The agent runs verification when it classifies an action as successful remediation on its normal completion path; verification can fail or report instability (agent finalization, verification outcomes).
Accuracy Mechanisms:
1. AI Analysis (Claude):
response = self._anthropic_client().messages.create(
model=self.model,
max_tokens=4096,
system=system_prompt,
tools=AGENT_TOOLS,
messages=messages,
)
The agent sends collected incident context and available organization documentation to Claude, then processes tool calls and final text (context preparation, Claude API call).
2. Evidence Checks:
The agent checks final responses with validate_resolution, which checks tool evidence and remediation or suggestions for supported incident types. It can request further evidence before returning; this is not a numeric confidence score (grounding checks, retry and completion logic).
3. Immediate Verification:
verification = await self.fix_verifier.verify_fix(
incident_type=issue_type,
fix_applied=_remediation_summary(actions_taken),
expected_state=_verification_expected_state(issue_type, context),
monitoring_duration=FIX_VERIFICATION_MONITORING_SECONDS,
)
This call runs when has_successful_remediation reports an applied action at normal completion; suggestions alone do not trigger it (agent finalization, remediation predicate). Checks dispatch by incident type to Kubernetes, CI/CD, server, cloud, or ArgoCD verification. Unsupported types and missing required target information fail verification (check dispatch, target checks).
4. Stability Monitoring:
After immediate checks pass, FixVerifier repeats the same target checks over the configured window. The agent requests 300 seconds; monitoring can stop early after repeated failed observations. The verifier reports success when at least 90% of its observations pass, and rejects non-positive monitoring durations. This percentage describes one verification window, not historical fix accuracy (agent window, monitoring implementation).
5. Failure Reporting and Rollback Tools:
The agent saves the verification result and attempts a Slack notification when SLACK_WEBHOOK_URL is configured, using warning severity when verification fails (result handling, notifier configuration check). Delivery is not guaranteed: the notifier logs exceptions from the HTTP POST and does not check the response status (notifier request handling). This completion path does not automatically roll back a failed or unstable fix (result handling). Kubernetes, ArgoCD, and Helm rollback tools are separate actions available to the agent (tool dispatch, ArgoCD dispatch, Helm dispatch).
Historical Accuracy¶
Available Verification Records:
| Record | Source | Meaning | Limitation |
|---|---|---|---|
| Immediate checks | FixVerifier | Target checks passed or failed | Depends on incident type and target information |
| Stability observations | Monitoring result | Passing observations within one monitoring window | Not a historical fix-success rate |
| Incident result | Agent result | Remediation, grounding, and verification recorded separately | resolved is computed before verification and is not gated by its result |
Overall Success Rate: The repository provides no measurement source for an overall or per-fix-type accuracy percentage. The implemented success_rate is the fraction of passing stability observations within one verification window (calculation).
When Fix Fails:
- Failed immediate checks return
status="failed"; failed stability monitoring returnsstatus="unstable"(verification results). - Verification results are saved; a Slack notification is attempted when
SLACK_WEBHOOK_URLis configured, without guaranteed delivery. The agent's result includes verification separately fromresolved(agent result handling, notifier configuration check, request handling). - Review the result before deciding on further remediation; automatic rollback is not part of this verification path (agent finalization).
Organization Usage - Security Checklist¶
Before Deployment¶
1. Security Configuration:
# Security scanner (the audit log is always on)
ENABLE_SECURITY_SCANNING=true
ENABLE_COMPLIANCE_CHECKS=true
# Email alerts for blocked commands and escalations
EMAIL_ENABLED=true
EMAIL_SMTP_HOST=smtp.company.com
EMAIL_TO=sre-team@company.com
# Set up authentication
WEBHOOK_SECRET=<strong-secret>
SLACK_SIGNING_SECRET=<slack-signing-secret>
API_ADMIN_TOKEN=<strong-random-token>
API_ORG_TOKENS=acme-corp=<token-a>
# Encrypt stored org credentials
ENCRYPT_CREDENTIALS=true
CREDENTIALS_MASTER_KEY=<fernet-key>
TLS is terminated in front of the agent (see Layer 3).
Webhook and Slack authentication use these separate secrets; the management API uses API_ADMIN_TOKEN / API_ORG_TOKENS (setting API_KEY does nothing) (webhook gate, Slack verification, API application).
ENCRYPT_CREDENTIALS=true enables Fernet encryption via CREDENTIALS_MASTER_KEY (or CREDENTIALS_MASTER_KEY_FILE).
2. Network Security:
# Firewall rules
iptables -A INPUT -p tcp --dport 8000 -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -p tcp --dport 8000 -j DROP
# VPC/Network configuration
VPC_ID=vpc-private
SUBNET=private-subnet
NO_PUBLIC_IP=true
3. RBAC Setup:
# Kubernetes RBAC
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: devops-ai-agent
rules:
# Read-only by default
- apiGroups: [""]
resources: ["pods", "services", "configmaps"]
verbs: ["get", "list", "watch"]
# Limited write permissions
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["patch"] # Only for restarts
# NO delete permissions
# NO namespace admin
# NO cluster admin
4. Monitoring Setup:
# Prometheus metrics are always served at /metrics; protect them with a token
METRICS_TOKEN=<strong-random-token>
# Alert destinations
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...
EMAIL_ENABLED=true
EMAIL_TO=security@company.com
There is no built-in SIEM integration; forward the agent's structured JSON logs and the
/audit log to your SIEM.
Security Certifications¶
Implemented Advisory Checks:
- CIS-oriented configuration findings - Text checks for privileged and non-root container settings and an
allowPrivilegeEscalationfinding (CIS checks). - SOC2-oriented configuration findings - Non-local HTTP endpoints and possible secrets embedded in configuration (SOC2 checks).
- PCI-DSS-oriented configuration findings - Long digit sequences resembling card data and non-local HTTP endpoints (PCI checks).
These findings do not establish SOC 2 Type II, ISO 27001, CIS, NIST CSF, GDPR, PCI-DSS, or HIPAA compliance or certification. The scanner selects only the CIS, SOC2, and PCI-labelled checks above; it ignores other framework names (framework dispatch).
Incident Response¶
If Security Incident Detected:
1. Automatic Response:
- Incident logged immediately
- Security team notified
- Agent paused (emergency stop)
- All actions stopped
- System state preserved
- Forensics data collected
2. Emergency Stop:
The safety helper reads AGENT_EMERGENCY_STOP from the agent process environment (flag reader). When active, the agent blocks tool names listed in MUTATING_AGENT_TOOLS before dispatch (tool gate, agent dispatch). GET /status (viewer token) reports the current flag as emergency_stop (status handler).
3. Investigation:
# Review audit logs
tail -f /var/log/devops-agent/audit.log
# Check security events
grep "SECURITY" /var/log/devops-agent/security.log
# Review all actions in last hour
jq '.timestamp > "2026-06-12T12:00:00Z"' audit.log
Questions Answered¶
Q1: Can my organization use it securely?¶
YES.
- Enterprise-grade security
- Webhook HMAC/shared-token checks and separate Slack signature checks when their secrets are configured (webhook auth, Slack auth).
- Complete audit trail
- Advisory CIS/SOC2/PCI-labelled configuration checks, not compliance certification (scanner dispatch).
- Network isolation support
- Org credential encryption at rest is optional (
ENCRYPT_CREDENTIALS+CREDENTIALS_MASTER_KEY)
Q2: Will it be hacked?¶
Highly unlikely with proper configuration:
- Webhook shared-secret checks require
WEBHOOK_SECRET; the management API requiresAPI_ADMIN_TOKENorAPI_ORG_TOKENSwith optional viewer/approver/admin roles (webhook gate, API handlers). - Slack signature verification requires
SLACK_SIGNING_SECRET(Slack verifier). Restrict who can click Approve withSLACK_APPROVER_IDS(global or per org); each decision is recorded with the Slack user who made it. - Optional
ALLOWED_IPSallowlist in the API; also configure IP filtering at the load balancer (api/ip_allowlist.py). - Deploy in private network
- VPN/bastion access only
- Regular security scanning
- No known vulnerabilities
Your responsibility:
- Keep API keys secret
- Use strong passwords
- Enable all security features
- Deploy in private network
- Regular security updates
- Monitor audit logs
Q3: Will it delete anything?¶
NO - Never deletes production data.
- All delete operations blocked
- Email sent before any risk
- Manual approval required
- Complete safety checks
- Verification completion does not automatically roll back; Kubernetes, ArgoCD, and Helm rollback tools are separate agent actions (completion path, Kubernetes, ArgoCD, Helm).
- Full audit trail
Safe operations only:
- Service restarts
- Config reloads
- Cache clearing
- Log rotation
- Temp file cleanup
Q4: Will fixes be accurate?¶
Fix verification reports target-check results; it does not establish a historical accuracy rate (verifier).
- Claude analysis uses collected context and tools (agent API call).
- Evidence checks validate final responses (grounding).
- Actions classified as successful remediation on normal completion trigger immediate checks and, if those pass, a requested 300-second stability window (agent finalization, verifier).
- Results can be failed or unstable; they are recorded without automatic rollback by this path. A Slack notification is attempted when
SLACK_WEBHOOK_URLis configured, without guaranteed delivery (verification outcomes, result handling, notifier configuration check, request handling).
Best Practices¶
1. Deployment¶
✅ Deploy in private network
✅ Use VPN or bastion host
✅ Enable all security features
✅ Set up email alerts
✅ Configure audit logging
✅ Use strong API keys
✅ Enable TLS/SSL
✅ Set up RBAC properly
❌ Expose directly to internet
❌ Use default credentials
❌ Disable security features
❌ Skip audit logging
2. Operations¶
✅ Review audit logs daily
✅ Monitor security alerts
✅ Update regularly
✅ Test in staging first
✅ Train team on agent
✅ Review documentation
✅ Maintain runbooks
❌ Ignore security alerts
❌ Skip updates
❌ Disable monitoring
❌ Give unnecessary permissions
3. Security¶
✅ Rotate API keys regularly
✅ Use secrets management (Vault)
✅ Enable 2FA for admin access
✅ Regular security audits
✅ Penetration testing
✅ SIEM integration
✅ Incident response plan
❌ Share credentials
❌ Store keys in git
❌ Disable encryption
❌ Skip security reviews
Support¶
Security Questions?
- Email: security@company.com
- Review:
docs/SECURITY_POLICY.md - Review:
docs/DEVSECOPS_GUIDE.md
Security Incident?
- Emergency stop: set
AGENT_EMERGENCY_STOP=truein the environment used to start the agent service (flag reader); checkemergency_stopinGET /status(viewer token) (status handler). - Email: security@company.com
- Review audit logs immediately
Summary¶
Your Organization Can Use This Agent Securely:
⚠️ Credential storage - Plaintext JSON without application-level encryption
✅ Safe - Never deletes data, email before risk, complete audit
✅ Verification - Immediate and stability checks report fix outcomes (FixVerifier).
✅ Advisory scanning - CIS/SOC2/PCI-labelled configuration findings (SecurityScanner).
✅ Transparent - Complete audit trail, full documentation
✅ Failure reporting - Verification results saved; Slack notification attempted when SLACK_WEBHOOK_URL is configured, without guaranteed delivery (agent finalization, notifier configuration check, request handling).
✅ Database optional - No DB access by default; enable only after security review
The agent is production-ready for enterprise deployment.
Database Access (Optional)¶
Default: DISABLED (ENABLE_DATABASE_COLLECTION=false)
The agent does not connect to or query databases unless you explicitly enable it.
Blocked by default:
- AWS: RDS, ElastiCache, DynamoDB
- GCP: Cloud SQL, Firestore, Memorystore
- Azure: SQL Database, Cosmos DB, Redis Cache
Still works without database access:
- Connection pool / timeout issues at the app layer
- Restarting app services, scaling pods
- Network, firewall, and load balancer checks
- Email to DBA team with manual investigation steps
To enable (security team approval required):
Only enable after:
- Security review and data classification approval
- Read-only IAM/RBAC roles scoped to specific instances
- Audit logging for all database API calls
See collectors/database_policy.py for implementation.
Last Updated: June 12, 2026 Classification: Public Version: 1.0