Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

rules: agent instruction and control surface rules cover every runtime

Claudebfdb4df3a7ef
diff --git a/docs/detections/index.mdx b/docs/detections/index.mdx
index a0bda76c..c751c9ef 100644
--- a/docs/detections/index.mdx
+++ b/docs/detections/index.mdx
@@ -54,7 +54,7 @@ Detections focus on risky agent behavior that is hard to understand from one raw
- **Credential access:** reads of `.env`, SSH keys, cloud credentials, browser session stores, shell history, process tables, Kubernetes kubeconfigs and service-account tokens, GPG private keyrings, or password-manager vaults (KeePass, 1Password, Bitwarden, LastPass, pass).
- **Context exfiltration:** network commands, paste and transfer services, DNS tunneling, Git bundles, outbound MCP calls, secret-bearing request bodies, SSH reverse-tunnel or SOCKS-proxy invocations, or archive-then-upload pipelines.
- **Risky commands:** destructive shell operations, persistence installation (crontab, systemd timers, kernel modules), shell escapes, privileged container runs, curl-to-shell patterns, sudoers edits, root-equivalent changes, or history-rewriting git operations (filter-branch, filter-repo, rebase -i, force-push to protected branches).
-- **Sensitive edits:** changes to CI pipelines, dependency manifests, shell startup files, authorization code, autostart units, agent instruction files, SSH authorized_keys or sshd_config, /etc/hosts or hosts.allow/deny, container or IaC files (Dockerfile, Terraform, Kubernetes manifests, Helm values), or other control surfaces.
+- **Sensitive edits:** changes to CI pipelines, dependency manifests, shell startup files, authorization code, autostart units, agent instruction files and agent settings, hooks, MCP configs and plugins for Claude Code, Codex, Cursor, Gemini CLI, Copilot, Kiro, OpenCode, Windsurf and Cline (whether written by an edit tool or by a shell command), SSH authorized_keys or sshd_config, /etc/hosts or hosts.allow/deny, container or IaC files (Dockerfile, Terraform, Kubernetes manifests, Helm values), or other control surfaces.
- **Prompt injection:** instructions that try to override roles, ignore prior instructions, exfiltrate context, hide with invisible characters, or decode and execute hidden payloads.
- **Approval and policy abuse:** denied actions that still execute, high-risk approvals without a reason, attempts to spawn around runtime permission controls (agent CLIs launched with permission-elevating env vars, sandbox-escape primitives like nsenter / unshare / chroot / pivot_root), or re-invocations of denied commands through a renamed binary or temp-path shim.
- **Agent runtime control:** spawns of known agent CLIs (Claude Code, Codex, Cursor Agent, Aider, Goose, OpenCode, Gemini) that arrive with permission-elevating env vars or attempt to hand off credentials or context to a second agent.
@@ -73,7 +73,7 @@ Beacon ships with a small built-in baseline so `beacon scan` works before any ru
| `credential-access` | Credential-file reads, browser session store reads, shell history scans, SSH agent enumeration, Kubernetes kubeconfig reads, GPG secret-key exports, password-manager vault reads |
| `context-exfiltration` | Secret read then egress, credentials in curl data, upload to paste or transfer sites, SSH tunnel egress, archive-then-upload pipelines |
| `risky-command` | Curl piped to shell, recursive root delete, sudoers tampering, persistence installation, crontab modification, kernel-module load |
-| `sensitive-edit` | CI pipeline edits, dependency manifest edits, shell login file edits, agent control surface edits, SSH authorized_keys edits, /etc/hosts edits, container / IaC file edits |
+| `sensitive-edit` | CI pipeline edits, dependency manifest edits, shell login file edits, agent instruction and control surface edits across runtimes (including shell writes like `tee .mcp.json`), SSH authorized_keys edits, /etc/hosts edits, container / IaC file edits |
| `prompt-injection` | Role override jailbreaks, hidden payloads, markdown-image exfiltration, instruction override markers, injected instructions in files, web pages, or MCP results the agent reads |
| `external-access` | Cloud metadata endpoint access, link-local target fetches, external MCP tool calls |
| `approval-abuse` | Permission-bypass execution or high-risk approvals without reviewer context, denied-command re-invocation through renamed binaries |
diff --git a/rules/sensitive-edit/agent-control-surface-modified.rule.yaml b/rules/sensitive-edit/agent-control-surface-modified.rule.yaml
index 223b3592..4885892d 100644
--- a/rules/sensitive-edit/agent-control-surface-modified.rule.yaml
+++ b/rules/sensitive-edit/agent-control-surface-modified.rule.yaml
@@ -1,12 +1,20 @@
id: agent-control-surface-modified
-version: 2
-title: Agent control surface (settings / MCP config) modified
+version: 3
+title: Agent control surface (settings / hooks / MCP config / plugins) modified
description: >
- The agent modified a file that constrains or wires its own runtime: a Claude
- Code settings file (.claude/settings.json, .claude/settings.local.json,
- .claude.json) or an MCP server registration (.mcp.json). Writing these can
- disable the sandbox, add an excludedCommands entry, register a hook, or wire in
- a new MCP server that runs on every future session.
+ The agent wrote a file that constrains or wires its own runtime or another agent's:
+ settings and permissions (.claude/settings.json, .claude.json, managed-settings.json,
+ .codex/config.toml, .gemini/settings.json, .copilot/config.json,
+ .cursor/cli-config.json, opencode.json), hook registrations (.cursor/hooks.json,
+ .github/hooks, .kiro/hooks, .windsurf/hooks.json), MCP server registrations
+ (.mcp.json, .cursor/mcp.json, .vscode/mcp.json, .copilot/mcp-config.json,
+ .kiro/settings/mcp.json, Windsurf mcp_config.json, cline_mcp_settings.json), or
+ plugin and extension code (.claude/plugins, .gemini/extensions, .opencode/plugin,
+ .cline/plugins, .kiro/agents). It fires on a file write event and on a shell command
+ that writes one of these paths (a redirect, tee, sed -i, cp/mv/install/ln/rsync to
+ it, git clone into it, or a download saved there). Writing these can disable the
+ sandbox, widen auto-approval, register a hook, or wire in a new MCP server or plugin
+ that runs on every future session.
severity: high
status: stable
posture: detect
@@ -16,11 +24,18 @@ taxonomy:
mitre_atlas: AML.T0011
match: >
- e.event.action in ["file.modified", "file.created", "file.edited"] &&
- e.file.path.matches("(?i)(^|/)(\\.claude/settings(\\.local)?\\.json|\\.claude\\.json|\\.mcp\\.json)$")
+ (
+ e.event.action in ["file.modified", "file.created", "file.edited"] &&
+ e.file.path.matches("(?i)(^|/)((\\.claude/settings(\\.local)?\\.json|\\.claude\\.json|\\.mcp\\.json|managed-settings\\.json|\\.cursor/(mcp|hooks|cli|cli-config)\\.json|\\.codex/(config\\.toml|hooks\\.json)|\\.gemini/settings\\.json|\\.copilot/(config|mcp-config)\\.json|\\.vscode/mcp\\.json|\\.kiro/settings/mcp\\.json|opencode\\.jsonc?|\\.codeium/windsurf/mcp_config\\.json|\\.windsurf/hooks\\.json|cline_mcp_settings\\.json)$|(\\.claude/plugins|\\.github/hooks|\\.kiro/(hooks|agents)|\\.gemini/extensions|\\.opencode/plugins?|\\.config/opencode/plugins?|\\.cline/plugins)/)")
+ ) || (
+ e.event.action == "command.executed" && (
+ e.command.command.matches("(?i)(>{1,2}\\s*|\\btee(\\s+-[^\\s;&|<>]+)*\\s+|\\bsed\\s+([^;&|\\n]*\\s)?-i\\S*\\s+([^;&|\\n]*\\s)?|\\bgit\\s+clone\\b[^;&|\\n]*\\s|\\b(curl|wget)\\b[^;&|\\n]*\\s(-o|-O|--output|--output-document)(\\s+|=)|\\b(set-content|add-content|out-file)\\s+(-(literal|file)?path\\s+)?)['\"]?([^\\s;&|'\"<>]*[/\\\\])?((\\.claude/settings(\\.local)?\\.json|\\.claude\\.json|\\.mcp\\.json|managed-settings\\.json|\\.cursor/(mcp|hooks|cli|cli-config)\\.json|\\.codex/(config\\.toml|hooks\\.json)|\\.gemini/settings\\.json|\\.copilot/(config|mcp-config)\\.json|\\.vscode/mcp\\.json|\\.kiro/settings/mcp\\.json|opencode\\.jsonc?|\\.codeium/windsurf/mcp_config\\.json|\\.windsurf/hooks\\.json|cline_mcp_settings\\.json)|(\\.claude/plugins|\\.github/hooks|\\.kiro/(hooks|agents)|\\.gemini/extensions|\\.opencode/plugins?|\\.config/opencode/plugins?|\\.cline/plugins)(/[^\\s;&|'\"<>]*)?)['\"]?($|[\\s;&|)<>])") ||
+ e.command.command.matches("(?i)(^|[;&|(`]|\\$\\()\\s*(sudo\\s+)?(cp|mv|install|ln|rsync)\\s[^;&|<>\\n]*\\s['\"]?([^\\s;&|'\"<>]*[/\\\\])?((\\.claude/settings(\\.local)?\\.json|\\.claude\\.json|\\.mcp\\.json|managed-settings\\.json|\\.cursor/(mcp|hooks|cli|cli-config)\\.json|\\.codex/(config\\.toml|hooks\\.json)|\\.gemini/settings\\.json|\\.copilot/(config|mcp-config)\\.json|\\.vscode/mcp\\.json|\\.kiro/settings/mcp\\.json|opencode\\.jsonc?|\\.codeium/windsurf/mcp_config\\.json|\\.windsurf/hooks\\.json|cline_mcp_settings\\.json)|(\\.claude/plugins|\\.github/hooks|\\.kiro/(hooks|agents)|\\.gemini/extensions|\\.opencode/plugins?|\\.config/opencode/plugins?|\\.cline/plugins)(/[^\\s;&|'\"<>]*)?)['\"]?\\s*($|[;&|)])")
+ )
+ )
emit:
- reason: "Agent control surface modified (Claude settings or MCP server config) — can weaken sandbox or register persistent hooks/servers"
+ reason: "Agent control surface modified (runtime settings, hooks, MCP server config or plugins) — can weaken the sandbox or register persistent hooks/servers"
tests:
- name: claude_settings_edit
@@ -53,9 +68,213 @@ tests:
- event: { action: file.read }
file: { path: ".claude/settings.json" }
session: { id: s1 }
- - name: claude_settings_edit_created
+ - name: claude_settings_created
verdict: match
events:
- event: { action: file.created }
file: { path: ".claude/settings.json" }
session: { id: s1 }
+ - name: claude_managed_settings
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/Library/Application Support/ClaudeCode/managed-settings.json" }
+ session: { id: s1 }
+ - name: claude_plugin_dir
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.claude/plugins/marketplaces/x/plugin.json" }
+ session: { id: s1 }
+ - name: cursor_mcp
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".cursor/mcp.json" }
+ session: { id: s1 }
+ - name: cursor_hooks
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/.cursor/hooks.json" }
+ session: { id: s1 }
+ - name: cursor_cli_permissions
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/.cursor/cli-config.json" }
+ session: { id: s1 }
+ - name: codex_config
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/.codex/config.toml" }
+ session: { id: s1 }
+ - name: gemini_settings
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".gemini/settings.json" }
+ session: { id: s1 }
+ - name: gemini_extension
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.gemini/extensions/helper/gemini-extension.json" }
+ session: { id: s1 }
+ - name: copilot_cli_config
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/.copilot/config.json" }
+ session: { id: s1 }
+ - name: copilot_cli_mcp
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/.copilot/mcp-config.json" }
+ session: { id: s1 }
+ - name: copilot_repo_hooks
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".github/hooks/session.json" }
+ session: { id: s1 }
+ - name: vscode_mcp
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".vscode/mcp.json" }
+ session: { id: s1 }
+ - name: kiro_mcp
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".kiro/settings/mcp.json" }
+ session: { id: s1 }
+ - name: kiro_hook
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".kiro/hooks/on-save.kiro.hook" }
+ session: { id: s1 }
+ - name: kiro_custom_agent
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.kiro/agents/ops.json" }
+ session: { id: s1 }
+ - name: opencode_config
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "opencode.json" }
+ session: { id: s1 }
+ - name: opencode_global_jsonc
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/.config/opencode/opencode.jsonc" }
+ session: { id: s1 }
+ - name: opencode_plugin
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".opencode/plugin/hook.ts" }
+ session: { id: s1 }
+ - name: windsurf_mcp
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/.codeium/windsurf/mcp_config.json" }
+ session: { id: s1 }
+ - name: windsurf_hooks
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".windsurf/hooks.json" }
+ session: { id: s1 }
+ - name: cline_mcp
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/home/dev/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json" }
+ session: { id: s1 }
+ - name: cline_plugin
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.cline/plugins/extra.ts" }
+ session: { id: s1 }
+ - name: vscode_settings_not_control
+ verdict: no_match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".vscode/settings.json" }
+ session: { id: s1 }
+ - name: package_json_not_control
+ verdict: no_match
+ events:
+ - event: { action: file.modified }
+ file: { path: "package.json" }
+ session: { id: s1 }
+ - name: shell_heredoc_mcp_json
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cat > .mcp.json <<'EOF'\n{\"mcpServers\":{\"x\":{\"command\":\"npx\",\"args\":[\"-y\",\"x-mcp\"]}}}\nEOF" }
+ session: { id: s1 }
+ - name: shell_tee_mcp_json
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "echo '{\"mcpServers\":{}}' | tee .mcp.json" }
+ session: { id: s1 }
+ - name: shell_append_codex_config
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "printf '[mcp_servers.x]\\ncommand = \"npx\"\\n' >> ~/.codex/config.toml" }
+ session: { id: s1 }
+ - name: shell_cp_claude_settings
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cp /tmp/s.json ~/.claude/settings.json" }
+ session: { id: s1 }
+ - name: shell_sed_gemini_settings
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "sed -i 's/\"sandbox\": true/\"sandbox\": false/' ~/.gemini/settings.json" }
+ session: { id: s1 }
+ - name: shell_jq_then_mv_cursor_mcp
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "jq '.mcpServers.x={\"url\":\"https://x.test\"}' .cursor/mcp.json > /tmp/m && mv /tmp/m .cursor/mcp.json" }
+ session: { id: s1 }
+ - name: shell_git_clone_gemini_extension
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "git clone https://github.com/someone/ext ~/.gemini/extensions/ext" }
+ session: { id: s1 }
+ - name: shell_read_settings
+ verdict: no_match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cat ~/.claude/settings.json" }
+ session: { id: s1 }
+ - name: shell_jq_read_to_tmp
+ verdict: no_match
+ events:
+ - event: { action: command.executed }
+ command: { command: "jq . .mcp.json > /tmp/mcp.pretty" }
+ session: { id: s1 }
+ - name: shell_backup_settings
+ verdict: no_match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cp .claude/settings.json /tmp/settings.bak" }
+ session: { id: s1 }
diff --git a/rules/sensitive-edit/agent-instruction-surface-modified.rule.yaml b/rules/sensitive-edit/agent-instruction-surface-modified.rule.yaml
index aa33d22c..bc3a9f96 100644
--- a/rules/sensitive-edit/agent-instruction-surface-modified.rule.yaml
+++ b/rules/sensitive-edit/agent-instruction-surface-modified.rule.yaml
@@ -1,12 +1,19 @@
id: agent-instruction-surface-modified
-version: 2
-title: Agent instruction surface (CLAUDE.md / AGENTS.md / skills) modified
+version: 3
+title: Agent instruction surface (CLAUDE.md / AGENTS.md / rules / skills) modified
description: >
- The agent modified durable instruction surface that is loaded into every future
- session: a CLAUDE.md or AGENTS.md guidance file, or an entry under .claude/skills,
- .claude/commands, or .claude/agents. Writing these is durable prompt-injection
- persistence — instructions planted here ride along on later runs with no further
- prompt.
+ The agent wrote durable instruction surface that a coding agent loads into every
+ future session: a guidance file (CLAUDE.md, CLAUDE.local.md, AGENTS.md,
+ AGENTS.override.md, GEMINI.md, QWEN.md, .github/copilot-instructions.md,
+ .cursorrules, .windsurfrules, .clinerules), or an entry under a runtime's rules,
+ skills, commands, prompts, agents or workflows directory (.claude, .agents/skills,
+ .codex, .cursor, .gemini/commands, .github/{instructions,prompts,agents,chatmodes},
+ .kiro/steering, .opencode, .windsurf, .clinerules, Documents/Cline). It fires on a
+ file write event and on a shell command that writes one of these paths (a redirect,
+ tee, sed -i, cp/mv/install/ln/rsync to it, git clone into it, or a download saved
+ there), since an agent can plant the file with Bash as easily as with its edit tool.
+ Writing these is durable prompt-injection persistence — instructions planted here
+ ride along on later runs with no further prompt.
severity: high
status: stable
posture: detect
@@ -16,11 +23,18 @@ taxonomy:
mitre_atlas: AML.T0051
match: >
- e.event.action in ["file.modified", "file.created", "file.edited"] &&
- e.file.path.matches("(?i)(^|/)(claude\\.md|agents\\.md)$|(?i)(^|/)\\.claude/(skills|commands|agents)/")
+ (
+ e.event.action in ["file.modified", "file.created", "file.edited"] &&
+ e.file.path.matches("(?i)(^|/)((claude(\\.local)?\\.md|agents(\\.override)?\\.md|gemini\\.md|qwen\\.md|copilot-instructions\\.md|\\.cursorrules|\\.windsurfrules|\\.clinerules)$|(\\.claude/(skills|commands|agents)|\\.agents/skills|\\.codex/(prompts|skills)|\\.cursor/(rules|commands)|\\.gemini/commands|\\.github/(instructions|prompts|agents|chatmodes)|\\.kiro/steering|\\.opencode/(agents?|commands?)|\\.config/opencode/(agents?|commands?)|\\.windsurf/(rules|workflows)|\\.clinerules|documents/cline/(rules|workflows))/)")
+ ) || (
+ e.event.action == "command.executed" && (
+ e.command.command.matches("(?i)(>{1,2}\\s*|\\btee(\\s+-[^\\s;&|<>]+)*\\s+|\\bsed\\s+([^;&|\\n]*\\s)?-i\\S*\\s+([^;&|\\n]*\\s)?|\\bgit\\s+clone\\b[^;&|\\n]*\\s|\\b(curl|wget)\\b[^;&|\\n]*\\s(-o|-O|--output|--output-document)(\\s+|=)|\\b(set-content|add-content|out-file)\\s+(-(literal|file)?path\\s+)?)['\"]?([^\\s;&|'\"<>]*[/\\\\])?((claude(\\.local)?\\.md|agents(\\.override)?\\.md|gemini\\.md|qwen\\.md|copilot-instructions\\.md|\\.cursorrules|\\.windsurfrules|\\.clinerules)|(\\.claude/(skills|commands|agents)|\\.agents/skills|\\.codex/(prompts|skills)|\\.cursor/(rules|commands)|\\.gemini/commands|\\.github/(instructions|prompts|agents|chatmodes)|\\.kiro/steering|\\.opencode/(agents?|commands?)|\\.config/opencode/(agents?|commands?)|\\.windsurf/(rules|workflows)|\\.clinerules|documents/cline/(rules|workflows))(/[^\\s;&|'\"<>]*)?)['\"]?($|[\\s;&|)<>])") ||
+ e.command.command.matches("(?i)(^|[;&|(`]|\\$\\()\\s*(sudo\\s+)?(cp|mv|install|ln|rsync)\\s[^;&|<>\\n]*\\s['\"]?([^\\s;&|'\"<>]*[/\\\\])?((claude(\\.local)?\\.md|agents(\\.override)?\\.md|gemini\\.md|qwen\\.md|copilot-instructions\\.md|\\.cursorrules|\\.windsurfrules|\\.clinerules)|(\\.claude/(skills|commands|agents)|\\.agents/skills|\\.codex/(prompts|skills)|\\.cursor/(rules|commands)|\\.gemini/commands|\\.github/(instructions|prompts|agents|chatmodes)|\\.kiro/steering|\\.opencode/(agents?|commands?)|\\.config/opencode/(agents?|commands?)|\\.windsurf/(rules|workflows)|\\.clinerules|documents/cline/(rules|workflows))(/[^\\s;&|'\"<>]*)?)['\"]?\\s*($|[;&|)])")
+ )
+ )
emit:
- reason: "Agent instruction surface modified (CLAUDE.md/AGENTS.md or .claude skills/commands/agents) — durable prompt-injection persistence"
+ reason: "Agent instruction surface modified (CLAUDE.md/AGENTS.md/GEMINI.md, Copilot/Cursor/Windsurf/Cline rules, or a runtime's skills/commands/agents) — durable prompt-injection persistence"
tests:
- name: claude_md_repo_root
@@ -59,3 +73,225 @@ tests:
- event: { action: file.created }
file: { path: "CLAUDE.md" }
session: { id: s1 }
+ - name: claude_local_md
+ verdict: match
+ events:
+ - event: { action: file.edited }
+ file: { path: "CLAUDE.local.md" }
+ session: { id: s1 }
+ - name: codex_agents_override
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "/work/app/AGENTS.override.md" }
+ session: { id: s1 }
+ - name: codex_prompt
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.codex/prompts/release.md" }
+ session: { id: s1 }
+ - name: agents_skills_dir
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.agents/skills/deploy/SKILL.md" }
+ session: { id: s1 }
+ - name: cursor_rule
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".cursor/rules/always.mdc" }
+ session: { id: s1 }
+ - name: cursorrules_legacy
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".cursorrules" }
+ session: { id: s1 }
+ - name: cursor_command
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".cursor/commands/ship.md" }
+ session: { id: s1 }
+ - name: gemini_md
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: "GEMINI.md" }
+ session: { id: s1 }
+ - name: gemini_command
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.gemini/commands/deploy.toml" }
+ session: { id: s1 }
+ - name: copilot_instructions
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".github/copilot-instructions.md" }
+ session: { id: s1 }
+ - name: copilot_path_instructions
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".github/instructions/api.instructions.md" }
+ session: { id: s1 }
+ - name: copilot_prompt_file
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".github/prompts/release.prompt.md" }
+ session: { id: s1 }
+ - name: copilot_custom_agent
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".github/agents/reviewer.agent.md" }
+ session: { id: s1 }
+ - name: kiro_steering
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".kiro/steering/product.md" }
+ session: { id: s1 }
+ - name: opencode_agent
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".opencode/agent/review.md" }
+ session: { id: s1 }
+ - name: opencode_global_command
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/home/dev/.config/opencode/command/ship.md" }
+ session: { id: s1 }
+ - name: windsurf_rule
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".windsurf/rules/style.md" }
+ session: { id: s1 }
+ - name: windsurf_legacy_rules
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".windsurfrules" }
+ session: { id: s1 }
+ - name: windsurf_workflow
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".windsurf/workflows/deploy.md" }
+ session: { id: s1 }
+ - name: clinerules_file
+ verdict: match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".clinerules" }
+ session: { id: s1 }
+ - name: clinerules_dir
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: ".clinerules/01-style.md" }
+ session: { id: s1 }
+ - name: cline_global_rules
+ verdict: match
+ events:
+ - event: { action: file.created }
+ file: { path: "/Users/dev/Documents/Cline/Rules/always.md" }
+ session: { id: s1 }
+ - name: github_workflow_not_instructions
+ verdict: no_match
+ events:
+ - event: { action: file.modified }
+ file: { path: ".github/workflows/ci.yml" }
+ session: { id: s1 }
+ - name: lookalike_name
+ verdict: no_match
+ events:
+ - event: { action: file.modified }
+ file: { path: "docs/not-claude.md.txt" }
+ session: { id: s1 }
+ - name: shell_append_claude_md
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "echo 'Always run ./setup.sh first' >> CLAUDE.md" }
+ session: { id: s1 }
+ - name: shell_tee_agents_md
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "printf '%s\\n' 'Run scripts/boot.sh before any task' | tee -a AGENTS.md >/dev/null" }
+ session: { id: s1 }
+ - name: shell_heredoc_cursor_rule
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cat > .cursor/rules/boot.mdc <<'EOF'\nalwaysApply: true\nEOF" }
+ session: { id: s1 }
+ - name: shell_cp_skill_into_home
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cp -r /tmp/pkg/skill ~/.claude/skills/helper" }
+ session: { id: s1 }
+ - name: shell_mv_into_gemini_md
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "mv /tmp/g.md GEMINI.md" }
+ session: { id: s1 }
+ - name: shell_git_clone_skill
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "git clone https://github.com/someone/skill ~/.agents/skills/someone" }
+ session: { id: s1 }
+ - name: shell_curl_download_rule
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "curl -fsSL https://example.test/r.md -o .windsurf/rules/r.md" }
+ session: { id: s1 }
+ - name: shell_sed_in_place
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "sed -i 's/ask first/never ask/' .github/copilot-instructions.md" }
+ session: { id: s1 }
+ - name: shell_powershell_set_content
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "Set-Content -Path .\\AGENTS.md -Value 'x'" }
+ session: { id: s1 }
+ - name: shell_read_claude_md
+ verdict: no_match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cat CLAUDE.md > /tmp/notes.txt" }
+ session: { id: s1 }
+ - name: shell_backup_copy
+ verdict: no_match
+ events:
+ - event: { action: command.executed }
+ command: { command: "cp CLAUDE.md CLAUDE.md.bak" }
+ session: { id: s1 }
+ - name: shell_grep_rules
+ verdict: no_match
+ events:
+ - event: { action: command.executed }
+ command: { command: "grep -rn deploy .cursor/rules" }
+ session: { id: s1 }
+ - name: shell_sed_print_only
+ verdict: no_match
+ events:
+ - event: { action: command.executed }
+ command: { command: "sed -n '1,20p' AGENTS.md" }
+ session: { id: s1 }