[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77120G58QHGZKCAG3ARMQDG":3,"skill-same:01M77120G58QHGZKCAG3ARMQDG":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":39,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M77120G58QHGZKCAG3ARMQDG","Canary Agent Safety Tripwire System",null,"Safety monitoring and tripwire detection for AI agents. Protects against unauthorized file access, dangerous commands, and excessive activity. Auto-halts on critical violations. Honeypot tripwires detect snooping.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fcanary-sr\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\r\nslug: \"canary-sr\"\r\nname: \"Canary Agent Safety Tripwire System\"\r\ndescription: \"Safety monitoring and tripwire detection for AI agents. Protects against unauthorized file access, dangerous commands, and excessive activity. Auto-halts on critical violations. Honeypot tripwires detect snooping.\"\r\nauthor: \"@TheShadowRose\"\r\nversion: \"1.0.8\"\r\ntags: [\"safety\", \"security\", \"tripwire\", \"monitoring\", \"honeypot\", \"agent-protection\"]\r\nlicense: \"MIT\"\r\n---\r\n\r\n# Canary Agent Safety Tripwire System\r\n\r\nSafety monitoring and tripwire detection for AI agents. Protects against unauthorized file access, dangerous commands, and excessive activity. Auto-halts on critical violations. Honeypot tripwires detect snooping.\r\n\r\n---\r\n\r\n**Safety monitoring and tripwire detection for AI agents.**\r\n\r\nProtects against unauthorized file access, dangerous commands, and excessive activity. Auto-halts on critical violations. Honeypot tripwires detect snooping.\r\n\r\n---\r\n\r\n## What It Does\r\n\r\nCanary provides three layers of agent safety:\r\n\r\n1. **Action Monitoring** - Checks file paths and commands before execution\r\n2. **Tripwire Files** - Honeypot files that should never be accessed\r\n3. **Audit Trail** - Complete logs and pattern detection\r\n\r\n### Core Features\r\n\r\n**Protected Paths:**\r\n- Block access to sensitive directories (`\u002Fetc\u002F`, `~\u002F.ssh\u002F`, etc.)\r\n- Customizable protection list\r\n- Granular operation control (read, write, delete)\r\n\r\n**Forbidden Patterns:**\r\n- Regular expression matching for dangerous commands\r\n- Detects `rm -rf \u002F`, `chmod 777`, `curl | sh`, etc.\r\n- Extensible pattern library\r\n\r\n**Rate Limiting:**\r\n- Limit file operations, network requests, command executions\r\n- Configurable windows and thresholds\r\n- Prevents runaway agents\r\n\r\n**Auto-Halt:**\r\n- Automatically stops agent after violation threshold\r\n- Prevents cascading failures\r\n- Requires manual review to restart\r\n\r\n**Tripwire Files:**\r\n- Create honeypot files that should never be accessed\r\n- Detect modifications, deletions, or access\r\n- Hash verification for file integrity\r\n\r\n**Audit Trail:**\r\n- Complete action logs\r\n- Violation history\r\n- Pattern detection (rapid violations, repeated targets, time clusters)\r\n- Export to JSON or Markdown\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n### Install\r\n\r\nNo dependencies! Python 3.7+ stdlib only.\r\n\r\n```bash\r\n# Copy config example\r\ncp config_example.json config.json\r\n\r\n# Edit config with your protected paths\r\nnano config.json\r\n```\r\n\r\n### Basic Usage\r\n\r\n```python\r\nfrom canary import CanaryMonitor\r\n\r\n# Initialize monitor\r\ncanary = CanaryMonitor('config.json')\r\n\r\n# Check path before access\r\nis_safe, reason = canary.check_path('\u002Fetc\u002Fpasswd', 'read')\r\nif not is_safe:\r\n    print(f\"Blocked: {reason}\")\r\n    exit(1)\r\n\r\n# Check command before execution\r\nis_safe, reason = canary.check_command('rm -rf \u002F')\r\nif not is_safe:\r\n    print(f\"Blocked: {reason}\")\r\n    exit(1)\r\n\r\n# Get status\r\nstatus = canary.get_status()\r\nprint(f\"Violations: {status['violation_count']}\u002F{status['halt_threshold']}\")\r\n```\r\n\r\n### CLI Usage\r\n\r\n```bash\r\n# Check status\r\npython3 canary.py status\r\n\r\n# Check if path is safe\r\npython3 canary.py check-path --path \u002Fetc\u002Fpasswd --operation read\r\n\r\n# Check if command is safe\r\npython3 canary.py check-command --command \"rm -rf \u002F\"\r\n\r\n# Reset monitoring (clears violations)\r\npython3 canary.py reset\r\n```\r\n\r\n---\r\n\r\n## Tripwire Files\r\n\r\nCreate honeypot files that should never be accessed:\r\n\r\n```bash\r\n# Create tripwire\r\npython3 canary_tripwire.py create \\\r\n  --path ~\u002F.secrets\u002Ffake-api-key.txt \\\r\n  --severity critical \\\r\n  --description \"Honeypot to detect credential snooping\"\r\n\r\n# List all tripwires\r\npython3 canary_tripwire.py list\r\n\r\n# Check for triggered tripwires\r\npython3 canary_tripwire.py check\r\n\r\n# View alert history\r\npython3 canary_tripwire.py alerts --limit 10\r\n\r\n# Remove tripwire\r\npython3 canary_tripwire.py remove --path ~\u002F.secrets\u002Ffake-api-key.txt\r\n```\r\n\r\n### Python API\r\n\r\n```python\r\nfrom canary_tripwire import TripwireManager\r\n\r\nmanager = TripwireManager()\r\n\r\n# Create tripwire\r\nmanager.create_tripwire(\r\n    path='~\u002F.aws\u002Ffake-credentials',\r\n    severity='critical',\r\n    description='Detects AWS credential access'\r\n)\r\n\r\n# Check all tripwires\r\ntriggered = manager.check_tripwires()\r\nif triggered:\r\n    print(f\"⚠️  {len(triggered)} tripwire(s) triggered!\")\r\n    for alert in triggered:\r\n        print(f\"  - {alert['path']}: {alert['event']}\")\r\n```\r\n\r\n---\r\n\r\n## Audit Reports\r\n\r\nAnalyze logs and generate safety reports:\r\n\r\n```bash\r\n# Summary report\r\npython3 canary_audit.py summary\r\n\r\n# View violations by severity\r\npython3 canary_audit.py violations --severity critical\r\n\r\n# Timeline of recent events\r\npython3 canary_audit.py timeline --hours 24\r\n\r\n# Detect suspicious patterns\r\npython3 canary_audit.py patterns\r\n\r\n# Export full report\r\npython3 canary_audit.py export --output report.json --format json\r\npython3 canary_audit.py export --output report.md --format markdown\r\n```\r\n\r\n### Python API\r\n\r\n```python\r\nfrom canary_audit import CanaryAuditor\r\n\r\nauditor = CanaryAuditor('canary.log')\r\n\r\n# Generate summary\r\nsummary = auditor.generate_summary_report()\r\nprint(f\"Total violations: {summary['total_violations']}\")\r\n\r\n# Get critical violations\r\ncritical = auditor.get_violations_by_severity('critical')\r\n\r\n# Detect patterns\r\npatterns = auditor.detect_patterns()\r\nif patterns['rapid_violations']:\r\n    print(\"⚠️  Rapid violation sequence detected!\")\r\n\r\n# Export report\r\nauditor.export_report('safety-report.md', format='markdown')\r\n```\r\n\r\n---\r\n\r\n## Configuration\r\n\r\nSee `config_example.json` for all options.\r\n\r\n### Essential Settings\r\n\r\n```json\r\n{\r\n  \"protected_paths\": [\r\n    \"\u002Fetc\u002F\",\r\n    \"~\u002F.ssh\u002F\",\r\n    \"~\u002Fcritical-data\u002F\"\r\n  ],\r\n  \"forbidden_patterns\": [\r\n    \"rm\\\\s+-rf\\\\s+\u002F\",\r\n    \"chmod\\\\s+777\",\r\n    \"curl.*\\\\|\\\\s*sh\"\r\n  ],\r\n  \"halt_threshold\": 5,\r\n  \"rate_limits\": {\r\n    \"file_operations\": {\"limit\": 100, \"window\": 60},\r\n    \"command_executions\": {\"limit\": 20, \"window\": 60}\r\n  }\r\n}\r\n```\r\n\r\n---\r\n\r\n## Integration Examples\r\n\r\n### With Agent Runtime\r\n\r\n```python\r\nfrom canary import CanaryMonitor\r\n\r\ncanary = CanaryMonitor('config.json')\r\n\r\ndef safe_file_read(path):\r\n    \"\"\"Read file with Canary check.\"\"\"\r\n    is_safe, reason = canary.check_path(path, 'read')\r\n    if not is_safe:\r\n        raise PermissionError(reason)\r\n    \r\n    with open(path, 'r') as f:\r\n        return f.read()\r\n\r\ndef safe_command(cmd):\r\n    \"\"\"Execute command with Canary check.\"\"\"\r\n    is_safe, reason = canary.check_command(cmd)\r\n    if not is_safe:\r\n        raise PermissionError(reason)\r\n    \r\n    import subprocess\r\n    cmd_list = cmd.split() if isinstance(cmd, str) else cmd\r\n    return subprocess.run(cmd_list, capture_output=True)\r\n```\r\n\r\n### Pre-Deployment Checks\r\n\r\n```python\r\n# Before deploying agent, verify Canary setup\r\nfrom canary import CanaryMonitor\r\n\r\ncanary = CanaryMonitor('config.json')\r\n\r\n# Verify protected paths are configured\r\nstatus = canary.get_status()\r\nif status['protected_paths_count'] == 0:\r\n    print(\"⚠️  No protected paths configured!\")\r\n    exit(1)\r\n\r\n# Test tripwire detection\r\nfrom canary_tripwire import TripwireManager\r\nmanager = TripwireManager()\r\n\r\n# Create test tripwire\r\nmanager.create_tripwire('\u002Ftmp\u002Fcanary-test.txt', severity='high')\r\n\r\n# Verify it exists\r\ntriggered = manager.check_tripwires()\r\nif not any(t['path'] == '\u002Ftmp\u002Fcanary-test.txt' for t in triggered):\r\n    print(\"✅ Tripwire system operational\")\r\n\r\n# Cleanup\r\nmanager.remove_tripwire('\u002Ftmp\u002Fcanary-test.txt', delete_file=True)\r\n```\r\n\r\n---\r\n\r\n## Use Cases\r\n\r\n### 1. Autonomous Agent Safety\r\n\r\nDeploy Canary alongside autonomous agents to prevent:\r\n- Accidental system file deletion\r\n- Credential exfiltration\r\n- Runaway command execution\r\n\r\n### 2. Multi-Agent Systems\r\n\r\nEach agent gets its own Canary instance with custom rules:\r\n- Research agent: limited network access\r\n- Coding agent: no production deployments\r\n- Admin agent: full access but strict audit\r\n\r\n### 3. Development\u002FTesting\r\n\r\nUse Canary during agent development:\r\n- Catch dangerous patterns early\r\n- Test rate limiting behavior\r\n- Verify safety mechanisms work\r\n\r\n### 4. Production Monitoring\r\n\r\nRun Canary in production:\r\n- Real-time violation alerts\r\n- Audit trail for compliance\r\n- Pattern detection for anomalies\r\n\r\n---\r\n\r\n## Architecture\r\n\r\n```\r\n┌─────────────────┐\r\n│   Your Agent    │\r\n└────────┬────────┘\r\n         │\r\n         ▼\r\n┌─────────────────┐      ┌──────────────────┐\r\n│ CanaryMonitor   │◄────►│  config.py       │\r\n│ (canary.py)     │      │  (your rules)    │\r\n└────────┬────────┘      └──────────────────┘\r\n         │\r\n         ├─────► canary.log (action log)\r\n         │\r\n         ▼\r\n┌─────────────────┐      ┌──────────────────┐\r\n│ TripwireManager │◄────►│ .canary_tripwires│\r\n│ (tripwire.py)   │      │ (honeypot files) │\r\n└────────┬────────┘      └──────────────────┘\r\n         │\r\n         └─────► alerts.log\r\n         \r\n         \r\n┌─────────────────┐\r\n│ CanaryAuditor   │───► reports (JSON\u002FMD)\r\n│ (audit.py)      │\r\n└─────────────────┘\r\n```\r\n\r\n---\r\n\r\n## Best Practices\r\n\r\n### Start Conservative\r\n\r\nBegin with strict rules, relax as needed:\r\n\r\n```python\r\nprotected_paths = [\r\n    '\u002F',  # Protect entire filesystem initially\r\n]\r\n\r\nhalt_threshold = 3  # Low threshold to catch issues early\r\n```\r\n\r\n### Use Tripwires Strategically\r\n\r\nPlace tripwires in sensitive locations:\r\n- Fake credential files\r\n- Empty \"secrets\" directories\r\n- Decoy config files\r\n\r\n### Review Logs Regularly\r\n\r\n```bash\r\n# Daily audit\r\npython3 canary_audit.py summary\r\n\r\n# Weekly deep dive\r\npython3 canary_audit.py patterns\r\npython3 canary_audit.py export --output weekly-report.md --format markdown\r\n```\r\n\r\n### Test Your Configuration\r\n\r\n```python\r\n# Verify Canary blocks what it should\r\ncanary = CanaryMonitor('config.json')\r\n\r\n# These should all be blocked\r\nassert not canary.check_path('\u002Fetc\u002Fpasswd', 'delete')[0]\r\nassert not canary.check_command('rm -rf \u002F')[0]\r\nassert not canary.check_command('chmod 777 \u002Ftmp')[0]\r\n\r\nprint(\"✅ Canary configuration verified\")\r\n```\r\n\r\n---\r\n\r\n## Limitations\r\n\r\nSee [LIMITATIONS.md](LIMITATIONS.md) for details.\r\n\r\n**Key constraints:**\r\n- Pattern matching is regex-based (not semantic analysis)\r\n- No built-in alerting (logs only)\r\n- Tripwires detect access, not intent\r\n- Rate limiting is per-session (doesn't survive restarts)\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT License - See [LICENSE](LICENSE)\r\n\r\n**Author:** Shadow Rose\r\n\r\n---\r\n\r\n## Why This Exists\r\n\r\nAI agents can do a lot of damage quickly:\r\n- One bad command can delete critical files\r\n- Runaway loops can exhaust resources\r\n- Compromised agents can exfiltrate credentials\r\n\r\nCanary provides defense-in-depth:\r\n- **Preventive:** Block dangerous actions before they happen\r\n- **Detective:** Tripwires catch snooping behavior\r\n- **Forensic:** Complete audit trail for post-incident analysis\r\n\r\nSimple, zero-dependency safety for autonomous agents.\r\n\r\n\r\n---\r\n\r\n\r\n## ⚠️ Security Note — Config File\r\n\r\nConfiguration is loaded from a JSON file. This is safe to share — no code execution.\r\n\r\n- Config path is validated for existence and size (1MB cap) before loading\r\n- Must be a `.json` file — `CanaryMonitor` raises `ValueError` if given a non-JSON path\r\n- Keep your config under version control; treat it as security policy\r\n\r\n## ⚠️ Security Note — Tripwire Deployment\r\n\r\n- **Paths are fully resolved** — `~` and relative paths are expanded via `Path.expanduser().resolve()` before creation and lookup. `'~\u002F.aws\u002Ffake-credentials'` will be placed in your actual home directory, not a literal `~` path.\r\n- **Use decoy paths only** — never point tripwires at real files containing sensitive data. Tripwires are honeypots; treat them as bait, not protection.\r\n- **`create_tripwire` will not overwrite existing files** — it checks for pre-existing files and refuses to proceed. Use dedicated empty paths for tripwires.\r\n- **Test in a sandbox first** — verify where logs, tripwires, and registry files are created before deploying. Confirm protected paths and auto-halt behavior in an isolated environment.\r\n- **Protect log and alert directories** — set filesystem permissions so alert logs are not world-readable. Canary writes plaintext logs; restrict access accordingly.\r\n- **Canary only blocks when called** — it is not an OS-level enforcement mechanism. Layer it with containers, filesystem permissions, and `auditd` for production deployments.\r\n\r\n## ⚠️ Disclaimer\r\n\r\nThis software is provided \"AS IS\", without warranty of any kind, express or implied.\r\n\r\n**USE AT YOUR OWN RISK.**\r\n\r\n- The author(s) are NOT liable for any damages, losses, or consequences arising from \r\n  the use or misuse of this software — including but not limited to financial loss, \r\n  data loss, security breaches, business interruption, or any indirect\u002Fconsequential damages.\r\n- This software does NOT constitute financial, legal, trading, or professional advice.\r\n- Users are solely responsible for evaluating whether this software is suitable for \r\n  their use case, environment, and risk tolerance.\r\n- No guarantee is made regarding accuracy, reliability, completeness, or fitness \r\n  for any particular purpose.\r\n- The author(s) are not responsible for how third parties use, modify, or distribute \r\n  this software after purchase.\r\n\r\nBy downloading, installing, or using this software, you acknowledge that you have read \r\nthis disclaimer and agree to use the software entirely at your own risk.\r\n\r\n\r\n**SECURITY DISCLAIMER:** This software provides supplementary security measures and \r\nis NOT a replacement for professional security auditing, penetration testing, or \r\ncompliance frameworks. No software can guarantee complete protection against all \r\nthreats. Users operating in regulated industries (healthcare, finance, legal) should \r\nconsult qualified security professionals and verify compliance with applicable \r\nregulations (GDPR, HIPAA, SOC2, etc.) independently.\r\n---\r\n\r\n## Support & Links\r\n\r\n| | |\r\n|---|---|\r\n| 🐛 **Bug Reports** | TheShadowyRose@proton.me |\r\n| ☕ **Ko-fi** | [ko-fi.com\u002Ftheshadowrose](https:\u002F\u002Fko-fi.com\u002Ftheshadowrose) |\r\n| 🛒 **Gumroad** | [shadowyrose.gumroad.com](https:\u002F\u002Fshadowyrose.gumroad.com) |\r\n| 🐦 **Twitter** | [@TheShadowyRose](https:\u002F\u002Ftwitter.com\u002FTheShadowyRose) |\r\n| 🐙 **GitHub** | [github.com\u002FTheShadowRose](https:\u002F\u002Fgithub.com\u002FTheShadowRose) |\r\n| 🧠 **PromptBase** | [promptbase.com\u002Fprofile\u002Fshadowrose](https:\u002F\u002Fpromptbase.com\u002Fprofile\u002Fshadowrose) |\r\n\r\n*Built with [OpenClaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw) — thank you for making this possible.*\r\n\r\n---\r\n\r\n🛠️ **Need something custom?** Custom OpenClaw agents & skills starting at $500. If you can describe it, I can build it. → [Hire me on Fiverr](https:\u002F\u002Fwww.fiverr.com\u002Fs\u002FjjmlZ0v)\r\n\r\n> **📦 Install note:** The slug `canary` was already taken on ClawHub.\r\n> Install this skill using: `clawhub install canary-sr`\r\n","# Canary Agent Safety Tripwire System\r\n\r\nSafety monitoring and tripwire detection for AI agents. Protects against unauthorized file access, dangerous commands, and excessive activity. Auto-halts on critical violations. Honeypot tripwires detect snooping.\r\n\r\n---\r\n\r\n**Safety monitoring and tripwire detection for AI agents.**\r\n\r\nProtects against unauthorized file access, dangerous commands, and excessive activity. Auto-halts on critical violations. Honeypot tripwires detect snooping.\r\n\r\n---\r\n\r\n## What It Does\r\n\r\nCanary provides three layers of agent safety:\r\n\r\n1. **Action Monitoring** - Checks file paths and commands before execution\r\n2. **Tripwire Files** - Honeypot files that should never be accessed\r\n3. **Audit Trail** - Complete logs and pattern detection\r\n\r\n### Core Features\r\n\r\n**Protected Paths:**\r\n- Block access to sensitive directories (`\u002Fetc\u002F`, `~\u002F.ssh\u002F`, etc.)\r\n- Customizable protection list\r\n- Granular operation control (read, write, delete)\r\n\r\n**Forbidden Patterns:**\r\n- Regular expression matching for dangerous commands\r\n- Detects `rm -rf \u002F`, `chmod 777`, `curl | sh`, etc.\r\n- Extensible pattern library\r\n\r\n**Rate Limiting:**\r\n- Limit file operations, network requests, command executions\r\n- Configurable windows and thresholds\r\n- Prevents runaway agents\r\n\r\n**Auto-Halt:**\r\n- Automatically stops agent after violation threshold\r\n- Prevents cascading failures\r\n- Requires manual review to restart\r\n\r\n**Tripwire Files:**\r\n- Create honeypot files that should never be accessed\r\n- Detect modifications, deletions, or access\r\n- Hash verification for file integrity\r\n\r\n**Audit Trail:**\r\n- Complete action logs\r\n- Violation history\r\n- Pattern detection (rapid violations, repeated targets, time clusters)\r\n- Export to JSON or Markdown\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n### Install\r\n\r\nNo dependencies! Python 3.7+ stdlib only.\r\n\r\n```bash\r\n# Copy config example\r\ncp config_example.json config.json\r\n\r\n# Edit config with your protected paths\r\nnano config.json\r\n```\r\n\r\n### Basic Usage\r\n\r\n```python\r\nfrom canary import CanaryMonitor\r\n\r\n# Initialize monitor\r\ncanary = CanaryMonitor('config.json')\r\n\r\n# Check path before access\r\nis_safe, reason = canary.check_path('\u002Fetc\u002Fpasswd', 'read')\r\nif not is_safe:\r\n    print(f\"Blocked: {reason}\")\r\n    exit(1)\r\n\r\n# Check command before execution\r\nis_safe, reason = canary.check_command('rm -rf \u002F')\r\nif not is_safe:\r\n    print(f\"Blocked: {reason}\")\r\n    exit(1)\r\n\r\n# Get status\r\nstatus = canary.get_status()\r\nprint(f\"Violations: {status['violation_count']}\u002F{status['halt_threshold']}\")\r\n```\r\n\r\n### CLI Usage\r\n\r\n```bash\r\n# Check status\r\npython3 canary.py status\r\n\r\n# Check if path is safe\r\npython3 canary.py check-path --path \u002Fetc\u002Fpasswd --operation read\r\n\r\n# Check if command is safe\r\npython3 canary.py check-command --command \"rm -rf \u002F\"\r\n\r\n# Reset monitoring (clears violations)\r\npython3 canary.py reset\r\n```\r\n\r\n---\r\n\r\n## Tripwire Files\r\n\r\nCreate honeypot files that should never be accessed:\r\n\r\n```bash\r\n# Create tripwire\r\npython3 canary_tripwire.py create \\\r\n  --path ~\u002F.secrets\u002Ffake-api-key.txt \\\r\n  --severity critical \\\r\n  --description \"Honeypot to detect credential snooping\"\r\n\r\n# List all tripwires\r\npython3 canary_tripwire.py list\r\n\r\n# Check for triggered tripwires\r\npython3 canary_tripwire.py check\r\n\r\n# View alert history\r\npython3 canary_tripwire.py alerts --limit 10\r\n\r\n# Remove tripwire\r\npython3 canary_tripwire.py remove --path ~\u002F.secrets\u002Ffake-api-key.txt\r\n```\r\n\r\n### Python API\r\n\r\n```python\r\nfrom canary_tripwire import TripwireManager\r\n\r\nmanager = TripwireManager()\r\n\r\n# Create tripwire\r\nmanager.create_tripwire(\r\n    path='~\u002F.aws\u002Ffake-credentials',\r\n    severity='critical',\r\n    description='Detects AWS credential access'\r\n)\r\n\r\n# Check all tripwires\r\ntriggered = manager.check_tripwires()\r\nif triggered:\r\n    print(f\"⚠️  {len(triggered)} tripwire(s) triggered!\")\r\n    for alert in triggered:\r\n        print(f\"  - {alert['path']}: {alert['event']}\")\r\n```\r\n\r\n---\r\n\r\n## Audit Reports\r\n\r\nAnalyze logs and generate safety reports:\r\n\r\n```bash\r\n# Summary report\r\npython3 canary_audit.py summary\r\n\r\n# View violations by severity\r\npython3 canary_audit.py violations --severity critical\r\n\r\n# Timeline of recent events\r\npython3 canary_audit.py timeline --hours 24\r\n\r\n# Detect suspicious patterns\r\npython3 canary_audit.py patterns\r\n\r\n# Export full report\r\npython3 canary_audit.py export --output report.json --format json\r\npython3 canary_audit.py export --output report.md --format markdown\r\n```\r\n\r\n### Python API\r\n\r\n```python\r\nfrom canary_audit import CanaryAuditor\r\n\r\nauditor = CanaryAuditor('canary.log')\r\n\r\n# Generate summary\r\nsummary = auditor.generate_summary_report()\r\nprint(f\"Total violations: {summary['total_violations']}\")\r\n\r\n# Get critical violations\r\ncritical = auditor.get_violations_by_severity('critical')\r\n\r\n# Detect patterns\r\npatterns = auditor.detect_patterns()\r\nif patterns['rapid_violations']:\r\n    print(\"⚠️  Rapid violation sequence detected!\")\r\n\r\n# Export report\r\nauditor.export_report('safety-report.md', format='markdown')\r\n```\r\n\r\n---\r\n\r\n## Configuration\r\n\r\nSee `config_example.json` for all options.\r\n\r\n### Essential Settings\r\n\r\n```json\r\n{\r\n  \"protected_paths\": [\r\n    \"\u002Fetc\u002F\",\r\n    \"~\u002F.ssh\u002F\",\r\n    \"~\u002Fcritical-data\u002F\"\r\n  ],\r\n  \"forbidden_patterns\": [\r\n    \"rm\\\\s+-rf\\\\s+\u002F\",\r\n    \"chmod\\\\s+777\",\r\n    \"curl.*\\\\|\\\\s*sh\"\r\n  ],\r\n  \"halt_threshold\": 5,\r\n  \"rate_limits\": {\r\n    \"file_operations\": {\"limit\": 100, \"window\": 60},\r\n    \"command_executions\": {\"limit\": 20, \"window\": 60}\r\n  }\r\n}\r\n```\r\n\r\n---\r\n\r\n## Integration Examples\r\n\r\n### With Agent Runtime\r\n\r\n```python\r\nfrom canary import CanaryMonitor\r\n\r\ncanary = CanaryMonitor('config.json')\r\n\r\ndef safe_file_read(path):\r\n    \"\"\"Read file with Canary check.\"\"\"\r\n    is_safe, reason = canary.check_path(path, 'read')\r\n    if not is_safe:\r\n        raise PermissionError(reason)\r\n    \r\n    with open(path, 'r') as f:\r\n        return f.read()\r\n\r\ndef safe_command(cmd):\r\n    \"\"\"Execute command with Canary check.\"\"\"\r\n    is_safe, reason = canary.check_command(cmd)\r\n    if not is_safe:\r\n        raise PermissionError(reason)\r\n    \r\n    import subprocess\r\n    cmd_list = cmd.split() if isinstance(cmd, str) else cmd\r\n    return subprocess.run(cmd_list, capture_output=True)\r\n```\r\n\r\n### Pre-Deployment Checks\r\n\r\n```python\r\n# Before deploying agent, verify Canary setup\r\nfrom canary import CanaryMonitor\r\n\r\ncanary = CanaryMonitor('config.json')\r\n\r\n# Verify protected paths are configured\r\nstatus = canary.get_status()\r\nif status['protected_paths_count'] == 0:\r\n    print(\"⚠️  No protected paths configured!\")\r\n    exit(1)\r\n\r\n# Test tripwire detection\r\nfrom canary_tripwire import TripwireManager\r\nmanager = TripwireManager()\r\n\r\n# Create test tripwire\r\nmanager.create_tripwire('\u002Ftmp\u002Fcanary-test.txt', severity='high')\r\n\r\n# Verify it exists\r\ntriggered = manager.check_tripwires()\r\nif not any(t['path'] == '\u002Ftmp\u002Fcanary-test.txt' for t in triggered):\r\n    print(\"✅ Tripwire system operational\")\r\n\r\n# Cleanup\r\nmanager.remove_tripwire('\u002Ftmp\u002Fcanary-test.txt', delete_file=True)\r\n```\r\n\r\n---\r\n\r\n## Use Cases\r\n\r\n### 1. Autonomous Agent Safety\r\n\r\nDeploy Canary alongside autonomous agents to prevent:\r\n- Accidental system file deletion\r\n- Credential exfiltration\r\n- Runaway command execution\r\n\r\n### 2. Multi-Agent Systems\r\n\r\nEach agent gets its own Canary instance with custom rules:\r\n- Research agent: limited network access\r\n- Coding agent: no production deployments\r\n- Admin agent: full access but strict audit\r\n\r\n### 3. Development\u002FTesting\r\n\r\nUse Canary during agent development:\r\n- Catch dangerous patterns early\r\n- Test rate limiting behavior\r\n- Verify safety mechanisms work\r\n\r\n### 4. Production Monitoring\r\n\r\nRun Canary in production:\r\n- Real-time violation alerts\r\n- Audit trail for compliance\r\n- Pattern detection for anomalies\r\n\r\n---\r\n\r\n## Architecture\r\n\r\n```\r\n┌─────────────────┐\r\n│   Your Agent    │\r\n└────────┬────────┘\r\n         │\r\n         ▼\r\n┌─────────────────┐      ┌──────────────────┐\r\n│ CanaryMonitor   │◄────►│  config.py       │\r\n│ (canary.py)     │      │  (your rules)    │\r\n└────────┬────────┘      └──────────────────┘\r\n         │\r\n         ├─────► canary.log (action log)\r\n         │\r\n         ▼\r\n┌─────────────────┐      ┌──────────────────┐\r\n│ TripwireManager │◄────►│ .canary_tripwires│\r\n│ (tripwire.py)   │      │ (honeypot files) │\r\n└────────┬────────┘      └──────────────────┘\r\n         │\r\n         └─────► alerts.log\r\n         \r\n         \r\n┌─────────────────┐\r\n│ CanaryAuditor   │───► reports (JSON\u002FMD)\r\n│ (audit.py)      │\r\n└─────────────────┘\r\n```\r\n\r\n---\r\n\r\n## Best Practices\r\n\r\n### Start Conservative\r\n\r\nBegin with strict rules, relax as needed:\r\n\r\n```python\r\nprotected_paths = [\r\n    '\u002F',  # Protect entire filesystem initially\r\n]\r\n\r\nhalt_threshold = 3  # Low threshold to catch issues early\r\n```\r\n\r\n### Use Tripwires Strategically\r\n\r\nPlace tripwires in sensitive locations:\r\n- Fake credential files\r\n- Empty \"secrets\" directories\r\n- Decoy config files\r\n\r\n### Review Logs Regularly\r\n\r\n```bash\r\n# Daily audit\r\npython3 canary_audit.py summary\r\n\r\n# Weekly deep dive\r\npython3 canary_audit.py patterns\r\npython3 canary_audit.py export --output weekly-report.md --format markdown\r\n```\r\n\r\n### Test Your Configuration\r\n\r\n```python\r\n# Verify Canary blocks what it should\r\ncanary = CanaryMonitor('config.json')\r\n\r\n# These should all be blocked\r\nassert not canary.check_path('\u002Fetc\u002Fpasswd', 'delete')[0]\r\nassert not canary.check_command('rm -rf \u002F')[0]\r\nassert not canary.check_command('chmod 777 \u002Ftmp')[0]\r\n\r\nprint(\"✅ Canary configuration verified\")\r\n```\r\n\r\n---\r\n\r\n## Limitations\r\n\r\nSee [LIMITATIONS.md](LIMITATIONS.md) for details.\r\n\r\n**Key constraints:**\r\n- Pattern matching is regex-based (not semantic analysis)\r\n- No built-in alerting (logs only)\r\n- Tripwires detect access, not intent\r\n- Rate limiting is per-session (doesn't survive restarts)\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT License - See [LICENSE](LICENSE)\r\n\r\n**Author:** Shadow Rose\r\n\r\n---\r\n\r\n## Why This Exists\r\n\r\nAI agents can do a lot of damage quickly:\r\n- One bad command can delete critical files\r\n- Runaway loops can exhaust resources\r\n- Compromised agents can exfiltrate credentials\r\n\r\nCanary provides defense-in-depth:\r\n- **Preventive:** Block dangerous actions before they happen\r\n- **Detective:** Tripwires catch snooping behavior\r\n- **Forensic:** Complete audit trail for post-incident analysis\r\n\r\nSimple, zero-dependency safety for autonomous agents.\r\n\r\n\r\n---\r\n\r\n\r\n## ⚠️ Security Note — Config File\r\n\r\nConfiguration is loaded from a JSON file. This is safe to share — no code execution.\r\n\r\n- Config path is validated for existence and size (1MB cap) before loading\r\n- Must be a `.json` file — `CanaryMonitor` raises `ValueError` if given a non-JSON path\r\n- Keep your config under version control; treat it as security policy\r\n\r\n## ⚠️ Security Note — Tripwire Deployment\r\n\r\n- **Paths are fully resolved** — `~` and relative paths are expanded via `Path.expanduser().resolve()` before creation and lookup. `'~\u002F.aws\u002Ffake-credentials'` will be placed in your actual home directory, not a literal `~` path.\r\n- **Use decoy paths only** — never point tripwires at real files containing sensitive data. Tripwires are honeypots; treat them as bait, not protection.\r\n- **`create_tripwire` will not overwrite existing files** — it checks for pre-existing files and refuses to proceed. Use dedicated empty paths for tripwires.\r\n- **Test in a sandbox first** — verify where logs, tripwires, and registry files are created before deploying. Confirm protected paths and auto-halt behavior in an isolated environment.\r\n- **Protect log and alert directories** — set filesystem permissions so alert logs are not world-readable. Canary writes plaintext logs; restrict access accordingly.\r\n- **Canary only blocks when called** — it is not an OS-level enforcement mechanism. Layer it with containers, filesystem permissions, and `auditd` for production deployments.\r\n\r\n## ⚠️ Disclaimer\r\n\r\nThis software is provided \"AS IS\", without warranty of any kind, express or implied.\r\n\r\n**USE AT YOUR OWN RISK.**\r\n\r\n- The author(s) are NOT liable for any damages, losses, or consequences arising from \r\n  the use or misuse of this software — including but not limited to financial loss, \r\n  data loss, security breaches, business interruption, or any indirect\u002Fconsequential damages.\r\n- This software does NOT constitute financial, legal, trading, or professional advice.\r\n- Users are solely responsible for evaluating whether this software is suitable for \r\n  their use case, environment, and risk tolerance.\r\n- No guarantee is made regarding accuracy, reliability, completeness, or fitness \r\n  for any particular purpose.\r\n- The author(s) are not responsible for how third parties use, modify, or distribute \r\n  this software after purchase.\r\n\r\nBy downloading, installing, or using this software, you acknowledge that you have read \r\nthis disclaimer and agree to use the software entirely at your own risk.\r\n\r\n\r\n**SECURITY DISCLAIMER:** This software provides supplementary security measures and \r\nis NOT a replacement for professional security auditing, penetration testing, or \r\ncompliance frameworks. No software can guarantee complete protection against all \r\nthreats. Users operating in regulated industries (healthcare, finance, legal) should \r\nconsult qualified security professionals and verify compliance with applicable \r\nregulations (GDPR, HIPAA, SOC2, etc.) independently.\r\n---\r\n\r\n## Support & Links\r\n\r\n| | |\r\n|---|---|\r\n| 🐛 **Bug Reports** | TheShadowyRose@proton.me |\r\n| ☕ **Ko-fi** | [ko-fi.com\u002Ftheshadowrose](https:\u002F\u002Fko-fi.com\u002Ftheshadowrose) |\r\n| 🛒 **Gumroad** | [shadowyrose.gumroad.com](https:\u002F\u002Fshadowyrose.gumroad.com) |\r\n| 🐦 **Twitter** | [@TheShadowyRose](https:\u002F\u002Ftwitter.com\u002FTheShadowyRose) |\r\n| 🐙 **GitHub** | [github.com\u002FTheShadowRose](https:\u002F\u002Fgithub.com\u002FTheShadowRose) |\r\n| 🧠 **PromptBase** | [promptbase.com\u002Fprofile\u002Fshadowrose](https:\u002F\u002Fpromptbase.com\u002Fprofile\u002Fshadowrose) |\r\n\r\n*Built with [OpenClaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw) — thank you for making this possible.*\r\n\r\n---\r\n\r\n🛠️ **Need something custom?** Custom OpenClaw agents & skills starting at $500. If you can describe it, I can build it. → [Hire me on Fiverr](https:\u002F\u002Fwww.fiverr.com\u002Fs\u002FjjmlZ0v)\r\n\r\n> **📦 Install note:** The slug `canary` was already taken on ClawHub.\r\n> Install this skill using: `clawhub install canary-sr`\r\n",{"name":5,"slug":24,"tags":25,"author":32,"license":15,"version":33,"description":7},"canary-sr",[26,27,28,29,30,31],"safety","security","tripwire","monitoring","honeypot","agent-protection","@TheShadowRose","1.0.8","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fc\u002Fcanary-sr",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill \"Canary Agent Safety Tripwire System\"",{"tool":49,"command":50},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill \"Canary Agent Safety Tripwire System\"",{"tool":52,"command":53},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill \"Canary Agent Safety Tripwire System\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fcanary-sr\u002FSKILL.md",true,[],[58,66,73,80,87,94],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":65},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":65},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":65},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":65},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":65},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":65},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]