.github/skills/agent-safety-governance/SKILL.md
Safety and governance framework for autonomous AI agents. Validates agent actions before execution, enforces permission boundaries, detects dangerous patterns (file deletion, env modification, network calls), and maintains audit trails. Use before deploying autonomous agents or when reviewing agent-generated code.
npx skillsauth add javiertarazon/agente-copilot agent-safety-governanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Validate, constrain, and audit autonomous agent actions before they affect production systems. Based on the Agent Safety Reviewer and Devil's Advocate agents from github/awesome-copilot.
"An autonomous agent that can't be stopped is not an asset — it's a liability."
Safety governance answers: What can this agent do? What should it NOT do? Who reviews what it did?
| Risk Level | Examples | Approval Required | |-----------|---------|------------------| | 🟢 LOW | Read files, search codebase, generate code suggestions | None — auto-execute | | 🟡 MEDIUM | Write/edit files, install packages, run tests | Log + continue | | 🟠 HIGH | Delete files, modify config, commit/push | Human review checkpoint | | 🔴 CRITICAL | Drop database, modify secrets, external API calls with side effects | Explicit confirmation + audit |
Before any autonomous task, validate:
✅ Does the task stay within the defined scope?
✅ Are the files to be modified listed in the task manifest?
✅ Is the agent working in the correct project directory?
✅ Is there a git checkpoint to rollback to?
Scan planned actions for:
DANGEROUS_PATTERNS = [
# File operations
"rm -rf", "shutil.rmtree", "fs.rmSync", "os.remove",
# Environment modification
".env", "process.env", "os.environ", "secrets",
# Network with side effects
"POST /production", "DELETE /api", "PUT /prod",
# Database
"DROP TABLE", "DELETE FROM", "TRUNCATE",
# Shell injection risks
"subprocess.call", "exec(", "eval(", "shell=True",
# Credential exposure
"password", "api_key", "token", "secret" + "print|log|console"
]
If any pattern detected → PAUSE and require human review.
agent_limits:
max_files_modified: 20 # Per task
max_file_size_kb: 500 # Max file to write
max_test_iterations: 10 # TDD fix loops
max_orchestration_depth: 5 # Nested sub-agents
timeout_minutes: 30 # Hard stop
allowed_directories:
- "src/"
- "tests/"
- "docs/"
forbidden_directories:
- ".env*"
- "*.secret"
- "infra/"
- ".ssh/"
Before completing any significant change, apply adversarial review:
Correctness:
Security:
Reliability:
Maintainability:
Completeness:
Every agent action should be logged:
{"ts":"2026-02-23T14:30:00Z","agent":"gem-orchestrator","action":"write_file","path":"src/services/user.ts","risk":"medium","outcome":"success","lines_changed":47}
{"ts":"2026-02-23T14:30:15Z","agent":"polyglot-test-pipeline","action":"run_tests","framework":"jest","outcome":"8_pass_0_fail","coverage":"87%"}
{"ts":"2026-02-23T14:31:00Z","agent":"context-architect","action":"multi_file_change","files_affected":5,"risk":"high","human_reviewed":true,"outcome":"success"}
Log location: copilot-agent/audit-log.jsonl
# Git rollback
git stash # undo uncommitted changes
git reset --hard HEAD~1 # undo last commit
# PowerShell equivalent
git checkout -- . # discard all unstaged changes
Before starting: git commit -m "checkpoint: pre-agent-task"
After each phase: git commit -m "checkpoint: post-research-phase"
After completion: git commit -m "feat: <description> [agent-assisted]"
Use this checklist when reviewing agent-proposed changes:
SCOPE
[ ] Changes are confined to listed files
[ ] No unauthorized external API calls
[ ] No credential or secret access
CODE QUALITY
[ ] Tests written or updated
[ ] No obvious security vulnerabilities
[ ] Error handling present
[ ] No dead code introduced
SAFETY
[ ] No irreversible operations (unguarded deletes)
[ ] Rollback is possible at any point
[ ] Audit log entry created
COMPLETENESS
[ ] All acceptance criteria met
[ ] Documentation updated if public API changed
[ ] Migration scripts included if schema changed
agent-orchestration to add safety gates between sub-agent callscontext-multi-file commitsverification-before-completion for final checkscopilot-agent/audit-log.jsonl (already used by OpenClaw agent system)tools
Automate GitHub repositories, issues, pull requests, branches, CI/CD, and permissions via Rube MCP (Composio). Manage code workflows, review PRs, search code, and handle deployments programmatically.
development
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or cre...
tools
Stage, commit, and push git changes with conventional commit messages. Use when user wants to commit and push changes, mentions pushing to remote, or asks to save and push their work. Also activate...
development
You are a PR optimization expert specializing in creating high-quality pull requests that facilitate efficient code reviews. Generate comprehensive PR descriptions, automate review processes, and ensu