Observe analyze

From backbay-labs/clawdstrike · View interactive version

Observe analyze is an AI agent skill from the GitHub repository backbay-labs/clawdstrike. Import and analyze agent activity logs to synthesize security policies

How to use this skill

Skill file

Observe & Analyze

Observe-Synth-Tighten Workflow

OBSERVE  -->  SYNTH  -->  TIGHTEN
  |             |            |
  v             v            v
Collect     Generate     Harden
events      candidate    iteratively
            policy

Phase 1: Observe

Collect agent activity events in JSONL format. Each event should have:

{"action_type": "file_access", "target": "/workspace/src/app.ts"}
{"action_type": "network_egress", "target": "api.openai.com"}
{"action_type": "shell_command", "target": "npm install express"}
{"action_type": "mcp_tool_call", "target": "read_file"}
{"action_type": "file_write", "target": "/workspace/src/utils.ts", "content": "export function add(a, b) { return a + b; }"}
Supported Action Types

| action_type | target field | content field |

|-------------|-------------|---------------|

| file_access | File path | - |

| file_write | File path | File content |

| network_egress / network | Domain or URL | - |

| shell_command / shell | Command string | - |

| mcp_tool_call / mcp_tool | Tool name | - |

| patch_apply / patch | File path | Patch content |

| user_input | - | User text |

Phase 2: Analyze

After collecting events, analyze patterns:

  1. Action distribution — What types of actions does the agent perform most?
  2. Network footprint — Which domains does the agent contact? Are any unexpected?
  3. File access patterns — What paths does the agent read/write? Any sensitive directories?
  4. Tool usage — Which MCP tools and shell commands are used?
  5. Anomalies — Any actions that look suspicious or out of pattern?

Phase 3: Synthesize

Call workbench_synth_policy with the JSONL events to generate a candidate policy. The synthesizer:

Phase 4: Validate & Test

  1. Call workbench_validate_policy on the synthesized policy.
  2. Call workbench_suggest_scenarios to generate test cases.
  3. Call workbench_run_all_scenarios to verify the policy works correctly.

Phase 5: Tighten

Review the synthesized policy and tighten it:

Event Analysis Tips

Red Flags in Events

Watch for these patterns that suggest the policy should be extra strict:

| Pattern | Risk | Action |

|---------|------|--------|

| Agent accesses .env or .ssh paths | Credential theft | Block with forbidden_path |

| Network calls to unknown/unusual domains | Data exfiltration | Restrict with egress_allowlist |

| Shell commands with pipes or redirections | Command injection | Enable shell_command guard |

| Many different MCP tools used | Over-privilege | Restrict with mcp_tool block |

| Large file writes | Data manipulation | Enable patch_integrity limits |

| User inputs with instruction keywords | Prompt injection | Enable prompt_injection guard |

Baseline Comparison

After synthesizing, compare the result against the strict ruleset using workbench_diff_policies to identify areas where the synthesized policy is weaker.

Instructions

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.