
clawdstrike
Runtime security enforcement for AI coding agents — policy hooks, audit receipts, threat hunting, and 15 MCP security tools.
- version
- 0.1.0
- GitHub stars
- 304
Install
/plugin install clawdstrike@clawdstrikeRun it inside Claude Code after adding the marketplace with /plugin marketplace add backbay-labs/clawdstrike.
Contents
Discovered from sourceSkills 3
Policy Guide
This skill activates when the user or conversation involves: - Questions about what actions are allowed or blocked - Policy configuration, guard behavior, or security rules - Choosing or comparing security rulesets - Understanding why an action was denied - Customizing guard settings or thresholds - Denial errors such as "action denied", "blocked by guard", or "policy violation" - Questions like "why was X blocked", "why can't I access Y", or "how do I allow Z"The 12 Built-in Guards
| Guard | Action Type | Purpose | Default Status |
|---|---|---|---|
| ForbiddenPathGuard | file | Blocks access to sensitive filesystem paths (e.g., /etc/shadow, ~/.ssh/id_rsa) | permissive: ON, default: ON, strict: ON |
| PathAllowlistGuard | file | Only allows file access to explicitly permitted paths | permissive: OFF, default: OFF, strict: ON |
| EgressAllowlistGuard | egress | Controls outbound network access by domain allowlist | permissive: OFF, default: ON, strict: ON |
| SecretLeakGuard | file | Detects secrets, API keys, and credentials in file writes | permissive: ON, default: ON, strict: ON |
| PatchIntegrityGuard | file | Validates that patches/diffs don't introduce unsafe changes | permissive: OFF, default: ON, strict: ON |
| ShellCommandGuard | shell | Blocks dangerous shell commands (rm -rf, sudo, etc.) | permissive: OFF, default: ON, strict: ON |
| McpToolGuard | mcp_tool | Restricts which MCP tools can be invoked | permissive: OFF, default: OFF, strict: ON |
| PromptInjectionGuard | prompt | Detects prompt injection attempts in inputs | permissive: OFF, default: ON, strict: ON |
| JailbreakGuard | prompt | 4-layer jailbreak detection (heuristic + statistical + ML + LLM-judge) | permissive: OFF, default: OFF, strict: ON |
| ComputerUseGuard | computer_use | Controls Computer Use Agent actions for remote desktop | permissive: OFF, default: OFF, strict: ON |
| RemoteDesktopSideChannelGuard | remote_desktop | Side-channel controls (clipboard, audio, drive mapping, file transfer) | permissive: OFF, default: OFF, strict: ON |
| InputInjectionCapabilityGuard | computer_use | Restricts input injection capabilities in CUA environments | permissive: OFF, default: OFF, strict: ON |
Available Rulesets
Use clawdstrike_policy_show to inspect any ruleset.
| Ruleset | Use Case |
|---|---|
permissive | Development/testing -- minimal restrictions |
default | General purpose -- balanced security |
strict | High-security environments -- maximum restrictions |
ai-agent | AI coding agents -- tuned for agent workflows |
cicd | CI/CD pipelines -- restricted to build/deploy operations |
ai-agent-posture | Agent posture assessment -- monitoring without blocking |
remote-desktop | Remote desktop sessions -- balanced CUA controls |
remote-desktop-permissive | Permissive CUA -- fewer restrictions for trusted environments |
remote-desktop-strict | Strict CUA -- maximum restrictions for untrusted environments |
How to Check Policies
Show active policy
Call clawdstrike_policy_show with no arguments to see the currently loaded policy, or pass a ruleset name to inspect a specific one.
Evaluate a hypothetical action
Call clawdstrike_policy_eval with an action_type and target to see which guards would fire and what the verdict would be, without actually executing the action.
Policy Inheritance
Policies support inheritance via the extends field:
- Built-in rulesets can be referenced by name (e.g.,
extends: strict) - Local files can be referenced by path
- Remote URLs and git refs are supported
- Child policies override parent settings; guards merge by name
Design Philosophy: Fail-Closed
ClawdStrike follows a fail-closed design:
- Invalid policies are rejected at load time (not silently ignored)
- Errors during guard evaluation result in deny (not allow)
- Unknown action types are denied by default
- Missing configuration causes startup failure, not permissive fallback
This means if something goes wrong, the system errs on the side of security rather than availability.
What To Do When Too Strict
If the active policy is blocking legitimate actions, follow these steps to relax it safely:
- Identify the blocking guard: Call
clawdstrike_policy_evalwith the denied action to see exactly which guard is blocking it. - Check if the action is expected: Verify the action is genuinely needed and not a misconfigured command or wrong path.
- Try a less restrictive ruleset: If on
strict, trydefaultorai-agent. Useclawdstrike_policy_showto compare what changes. - Create a custom override: Extend the current ruleset and override only the specific guard:
version: "1.5.0" extends: strict guards: ForbiddenPathGuard: additional_allowed_paths: - "/path/that/was/blocked" - Add path-specific exceptions: For file guards, add paths to allowlists rather than disabling the guard entirely.
- Disable a single guard as last resort: Set
enabled: falsefor a specific guard only if the above options do not work. Never disable SecretLeakGuard in production. - Re-verify: After changes, run
clawdstrike_policy_evalagain to confirm the action is now allowed without opening unintended gaps.
Response Guidelines
When this skill is active:
- Use
clawdstrike_policy_showandclawdstrike_policy_evalto give concrete answers - Explain guard behavior in terms of what the user is trying to do
- Recommend the most appropriate ruleset for the user's use case
- When an action is denied, explain which guard blocked it and why
Security Review
This skill activates when the user or conversation involves: - Multi-file edits touching security-sensitive paths (auth, config, credentials, .env, keys) - Shell commands that modify system state, install packages, or change permissions - New dependency additions or version changes - Changes to CI/CD, Docker, or infrastructure configuration - File writes to sensitive directories (/etc, ~/.ssh, ~/.aws, ~/.config) - File reads of sensitive paths (private keys, credential stores, token caches, certificate files) - Any content containing these keywords: "secret", "credential", "API key", "token", "password", "private key", "certificate", ".env", "auth", "permission"Security Checklist
Before proceeding with risky actions, use the clawdstrike_check MCP tool to verify policy compliance:
- Pre-flight check: Call
clawdstrike_checkwith the action_type and target before executing - Secret scanning: Verify no secrets, API keys, or credentials are being written to files
- Dependency audit: For new dependencies, check for known vulnerabilities
- Permission scope: Ensure file operations stay within allowed paths
- Shell safety: Validate shell commands against the ShellCommandGuard policy
Action Type Mapping
Use these action_type values when calling clawdstrike_check:
| Scenario | action_type | target |
|---|---|---|
| Writing/reading files | file | Absolute file path |
| Running shell commands | shell | The command string |
| HTTP/network requests | egress | Domain or URL |
| Installing packages | shell | Install command |
| MCP tool invocation | mcp_tool | Tool name |
Response Guidelines
When this skill is active:
- Proactively call
clawdstrike_checkbefore file writes to sensitive paths - Flag potential security issues with severity levels (Critical/High/Medium/Low)
- Suggest safer alternatives when an action would be blocked by policy
- Reference specific guards that would evaluate the action
Recommended Tools
Use these MCP tools in order of priority when this skill activates:
| Tool | When to Use |
|---|---|
clawdstrike_check | Before any file write, shell command, or egress -- the primary enforcement tool |
clawdstrike_policy_eval | To test hypothetical actions without executing them -- use for planning |
clawdstrike_policy_show | To understand which guards are active and what the current restrictions are |
clawdstrike_scan | To audit all MCP server configs for misconfigurations before a review |
clawdstrike_policy_lint | To validate policy YAML files for syntax/schema errors |
Guard Reference
These guards are evaluated during checks:
- ForbiddenPathGuard - Blocks access to sensitive filesystem paths
- PathAllowlistGuard - Enforces allowlist-based path access
- SecretLeakGuard - Detects secrets/credentials in file content
- ShellCommandGuard - Blocks dangerous shell commands
- EgressAllowlistGuard - Controls outbound network access
- PatchIntegrityGuard - Validates patch/diff safety
Threat Hunt
This skill activates when the user or conversation involves: - Investigating security events or suspicious activity - Breach investigation or incident response - Threat hunting across audit logs or event streams - Indicators of Compromise (IOCs) such as suspicious IPs, domains, hashes, or file paths - Correlating security events across multiple sources - MITRE ATT&CK technique references - "BLOCKED by Clawdstrike" or similar denial messages appearing in conversation output - Repeated policy denials or unexpected security enforcement behaviorInvestigation Workflow
Follow this structured approach when investigating security events:
1. Establish Timeline
Call clawdstrike_timeline to get a chronological view of recent events:
- Start with a broad time range, then narrow down
- Look for clusters of activity that indicate automated or coordinated actions
- Note any gaps that might indicate log tampering
2. Query and Filter
Use clawdstrike_query to drill into specific criteria:
- Filter by verdict (allow/deny/audit) to find blocked actions
- Filter by action_type (file/shell/egress/mcp_tool) to focus investigation
- Filter by guard name to see which security controls were triggered
- Search for specific paths, commands, or domains
3. Correlate Events
Run clawdstrike_correlate to detect patterns across events:
- Use built-in correlation rules to identify attack sequences
- Look for lateral movement patterns (multiple targets from one source)
- Detect privilege escalation attempts (sequence of increasingly sensitive operations)
- Identify data exfiltration patterns (sensitive file reads followed by egress)
4. Check IOCs
Use clawdstrike_ioc to check indicators against threat intelligence:
- Submit suspicious domains, IPs, file hashes, or paths
- Cross-reference with known threat actor TTPs
- Check if IOCs appear in multiple events (indicating persistence)
5. Generate Report
Call clawdstrike_report to produce a structured investigation summary:
- Include timeline of events, findings, and recommended actions
- Reference specific events by ID for traceability
- Map findings to MITRE ATT&CK techniques where applicable
MITRE ATT&CK Quick Reference
Common techniques to look for in agent security events:
| Technique | ID | Indicators |
|---|---|---|
| Command and Scripting Interpreter | T1059 | Shell commands with encoded payloads, eval/exec usage |
| File and Directory Discovery | T1083 | Enumeration of sensitive directories |
| Exfiltration Over Web Service | T1567 | Egress to uncommon domains after file reads |
| Credential Access | T1552 | Access to .env, .ssh, credential files |
| Defense Evasion | T1562 | Attempts to modify security config or disable guards |
| Persistence | T1546 | Modifications to shell profiles, cron, startup files |
| Privilege Escalation | T1548 | sudo/chmod/chown commands, setuid changes |
MITRE Technique to MCP Tool Mapping
Use this table to select the right investigation tool for each technique:
| MITRE Technique | ID | Primary MCP Tool | Investigation Approach |
|---|---|---|---|
| Command and Scripting Interpreter | T1059 | clawdstrike_query | Filter by action_type=shell, look for encoded payloads or eval/exec |
| File and Directory Discovery | T1083 | clawdstrike_timeline | Broad timeline scan for sequential file reads across sensitive dirs |
| Exfiltration Over Web Service | T1567 | clawdstrike_correlate | Correlate file reads followed by egress to uncommon domains |
| Credential Access | T1552 | clawdstrike_query | Filter by action_type=file targeting .env, .ssh, credential paths |
| Defense Evasion | T1562 | clawdstrike_query | Filter for policy modification attempts or guard config changes |
| Persistence | T1546 | clawdstrike_ioc | Check shell profile, cron, and startup file modifications |
| Privilege Escalation | T1548 | clawdstrike_query | Filter by action_type=shell for sudo, chmod, chown, setuid |
Incident Classification
Classify incidents using these severity levels:
| Classification | Criteria | Response |
|---|---|---|
| P1 - Critical | Active exploitation, data exfiltration confirmed, credential compromise | Immediate remediation, revoke credentials, isolate affected sessions |
| P2 - High | Blocked exploit attempt, repeated policy violations, suspicious lateral movement | Investigate within current session, tighten policy, monitor for recurrence |
| P3 - Medium | Single denied action matching known TTP, anomalous but unconfirmed activity | Log for review, verify policy coverage, check for related events |
| P4 - Low | Informational anomaly, policy audit events, benign tool misuse | Document in report, no immediate action required |
Response Guidelines
When this skill is active:
- Present findings in order of severity and confidence
- Always provide specific event IDs and timestamps
- Recommend concrete remediation steps for each finding
- Distinguish between confirmed threats and suspicious activity requiring further investigation
Commands 6
ClawdStrike Audit
Display a chronological security audit trail for the current session.
Arguments
$ARGUMENTS(optional): Session ID to filter audit events. If provided, only show events for that session. If omitted, show events for the current session.
Steps
- Call
clawdstrike_timelineMCP tool with the current session context (or the session ID passed as$ARGUMENTSif provided) - Format the results as a chronological table with these columns:
| Timestamp | Action | Target | Verdict | Guard | Details |
|---|
Column Meanings
| Column | Description |
|---|---|
| Timestamp | ISO-8601 time when the action was evaluated |
| Action | The action_type that was checked (file, shell, egress, mcp_tool, prompt, computer_use) |
| Target | The specific resource: file path, command string, domain, tool name |
| Verdict | The enforcement decision: ALLOW, DENY, or AUDIT |
| Guard | The guard that produced the verdict (or "all" if multiple agreed) |
| Details | Additional context such as matched pattern, denial reason, or evidence snippet |
-
Use these verdict indicators:
ALLOWfor permitted actionsDENYfor blocked actionsAUDITfor logged-but-allowed actions
-
After the table, provide a summary:
- Total actions evaluated
- Number of allows, denies, and audits
- Most frequently triggered guards
- Any patterns worth noting (e.g., repeated denials on the same target)
If the session has no events yet, indicate that no actions have been evaluated in this session.
Common Audit Queries
These are common patterns to look for when reviewing audit trails:
| Query | How to Investigate |
|---|---|
| All denied actions | Filter the table to Verdict = DENY rows. Look for patterns in targets. |
| Actions on a specific file | Search the Target column for the file path. Note the sequence of actions. |
| Guard-specific activity | Filter by Guard column to see all evaluations for a single guard (e.g., SecretLeakGuard). |
| Escalation attempts | Look for sequences: file reads of credentials followed by shell commands or egress. |
| High-frequency targets | Count occurrences per Target. Repeated denials on the same target suggest misconfiguration or probing. |
ClawdStrike Policy
Display the active security policy with guard configuration details.
Steps
-
Call
clawdstrike_policy_showMCP tool to retrieve the current policy -
Present the policy metadata:
- Policy name and schema version
- Base ruleset (if using
extends) - Number of enabled/disabled guards
-
Format guard configurations as a table:
| Guard | Status | Key Settings |
|---|---|---|
| ForbiddenPathGuard | Enabled/Disabled | Blocked paths list |
| PathAllowlistGuard | Enabled/Disabled | Allowed paths list |
| EgressAllowlistGuard | Enabled/Disabled | Allowed domains |
| SecretLeakGuard | Enabled/Disabled | Detection patterns |
| PatchIntegrityGuard | Enabled/Disabled | Validation rules |
| ShellCommandGuard | Enabled/Disabled | Blocked commands |
| McpToolGuard | Enabled/Disabled | Tool allowlist/denylist |
| PromptInjectionGuard | Enabled/Disabled | Detection threshold |
| JailbreakGuard | Enabled/Disabled | Detection layers |
| ComputerUseGuard | Enabled/Disabled | Allowed actions |
| RemoteDesktopSideChannelGuard | Enabled/Disabled | Channel restrictions |
| InputInjectionCapabilityGuard | Enabled/Disabled | Capability restrictions |
- If any guards are disabled, note what action types are unprotected as a result.
Per-Guard Impact
For each guard, explain what changes when it is enabled vs disabled:
| Guard | When Enabled | When Disabled |
|---|---|---|
| ForbiddenPathGuard | Access to sensitive paths (e.g., /etc/shadow, ~/.ssh) is blocked | All file paths accessible; rely on OS-level permissions only |
| PathAllowlistGuard | Only explicitly listed paths are accessible; everything else is denied | File access governed only by ForbiddenPathGuard (denylist) |
| EgressAllowlistGuard | Only listed domains can be contacted; all other egress is blocked | Unrestricted outbound network access |
| SecretLeakGuard | File writes are scanned for secrets; matches are denied | Secrets can be written to files without detection |
| PatchIntegrityGuard | Patches/diffs are validated for unsafe patterns before application | Patches applied without safety checks |
| ShellCommandGuard | Dangerous commands (rm -rf, sudo, curl|bash) are blocked | All shell commands allowed without restriction |
| McpToolGuard | Only allowlisted MCP tools can be invoked | All MCP tools accessible |
| PromptInjectionGuard | Input text is scanned for injection patterns | Prompt injection attempts pass through undetected |
| JailbreakGuard | Multi-layer jailbreak detection active (heuristic + statistical + ML + LLM-judge) | No jailbreak detection |
| ComputerUseGuard | CUA actions restricted to allowed types | Unrestricted computer use actions |
| RemoteDesktopSideChannelGuard | Side channels (clipboard, audio, drives, file transfer) restricted | No side-channel controls |
| InputInjectionCapabilityGuard | Input injection capabilities restricted in CUA environments | Unrestricted input injection |
Guard Dependencies
Some guards interact with or override each other:
- PathAllowlistGuard overrides ForbiddenPathGuard: When PathAllowlistGuard is enabled, it acts as the primary file access control. ForbiddenPathGuard still runs as a second layer, but PathAllowlistGuard's allowlist is the first gate. A path must pass both guards.
- ShellCommandGuard and ForbiddenPathGuard: Shell commands that reference file paths are checked by ShellCommandGuard for the command itself, but the file paths within the command are not separately checked by ForbiddenPathGuard. Use both guards for defense-in-depth.
- McpToolGuard and other guards: McpToolGuard controls which tools can be called, but does not inspect the arguments. Other guards (e.g., ShellCommandGuard for a shell tool, EgressAllowlistGuard for a fetch tool) evaluate the action the tool performs.
- PromptInjectionGuard and JailbreakGuard: Both evaluate prompt/input content but use different detection strategies. JailbreakGuard is more comprehensive (4 layers) but higher latency. They can run independently or together for layered defense.
ClawdStrike Posture
Perform a comprehensive security posture assessment and produce a letter grade (A-F).
Steps
- Get active policy: Call
clawdstrike_policy_showto retrieve the current policy and guard configuration - Scan MCP configs: Call
clawdstrike_scanto check all MCP server configurations for issues - Check recent denials: Call
clawdstrike_querywithverdict=denyto find recent policy violations
Scoring
Assess posture across these categories and assign a sub-grade (A-F) to each:
| Category | Weight | What to Check |
|---|---|---|
| Policy Strength | 25% | Ruleset level (strict > default > permissive), number of enabled guards |
| MCP Config | 25% | Scan findings -- critical/high issues lower the grade |
| Violation Rate | 25% | Frequency and severity of recent denials |
| Coverage | 25% | Guard coverage across action types (file, shell, egress, mcp_tool) |
Grade Scale
| Grade | Score Range | Criteria |
|---|---|---|
| A | 90 - 100 | Strong security posture, strict policy, no critical findings |
| B | 80 - 89 | Good posture, minor gaps or medium findings |
| C | 70 - 79 | Moderate posture, some high findings or significant gaps |
| D | 60 - 69 | Weak posture, critical findings or major gaps in coverage |
| F | 0 - 59 | Minimal security, permissive policy with unaddressed critical issues |
Scoring Examples
Policy Strength (25 points max):
strictruleset with all guards enabled: 25defaultruleset with most guards enabled: 20ai-agentruleset with standard config: 18permissiveruleset: 5- No policy loaded: 0
MCP Config (25 points max):
- Zero findings across all servers: 25
- Low findings only: 20
- Medium findings present: 15
- High findings present: 8
- Critical findings present: 0
Violation Rate (25 points max):
- No denials in session: 25
- Occasional denials, no pattern: 20
- Repeated denials on same target (misconfiguration): 15
- Frequent denials with escalation patterns: 5
- Active exploit attempts detected: 0
Coverage (25 points max):
- All 4 action types covered (file, shell, egress, mcp_tool): 25
- 3 of 4 action types covered: 18
- 2 of 4 action types covered: 12
- 1 action type covered: 6
- No guard coverage: 0
Output Format
Security Posture: [GRADE]
Policy Strength: [grade] - [details]
MCP Config: [grade] - [details]
Violation Rate: [grade] - [details]
Guard Coverage: [grade] - [details]
Recommendations:
1. [Most impactful improvement]
2. [Second priority]
3. [Third priority]
ClawdStrike Scan
Scan all configured MCP servers for security vulnerabilities and policy violations.
Steps
- Call the
clawdstrike_scanMCP tool to analyze the current MCP server configurations - Group findings by severity level: Critical, High, Medium, Low
- Present results in this format:
Output Format
For each finding:
- Severity: Critical/High/Medium/Low
- Guard: Which guard detected the issue
- Target: The affected MCP server or configuration
- Issue: What was found
- Remediation: Specific steps to fix the issue
Severity to Risk Mapping
| Severity | Risk Category | Examples |
|---|---|---|
| Critical | RCE / Arbitrary code execution | MCP server with unrestricted shell access, eval-based tool handlers, unsandboxed code interpreters |
| High | Auth bypass / Secret exposure | Missing authentication on MCP endpoints, credentials in server config, overprivileged tool permissions |
| Medium | Config drift / Overprivileged access | Egress allowlist too broad, file access beyond project scope, deprecated TLS versions |
| Low | Info disclosure / Best practice | Verbose error messages, missing rate limiting, no audit logging configured |
Remediation Priority
Address findings in severity order:
- Critical: Fix immediately. These represent active exploitation vectors. Block the affected MCP server until remediated.
- High: Fix before next session. These could lead to credential compromise or unauthorized access.
- Medium: Fix within the current work cycle. These represent security debt that increases risk over time.
- Low: Track and fix opportunistically. These improve defense-in-depth but are not urgent.
Summary
End with a summary line:
Scan complete: X critical, Y high, Z medium, W low findings across N MCP servers.
If no issues are found, confirm that all configurations pass policy checks.
ClawdStrike Selftest
Run a comprehensive self-test to verify that all ClawdStrike components are operational. Reports PASS/FAIL for each check with an overall score.
Steps
Run each of the following 6 checks in order. For each check, report PASS or FAIL with details.
Check 1: CLI Binary
What it tests: The clawdstrike CLI binary is installed and executable.
How to check: Run clawdstrike --version using the Bash tool.
PASS: Command exits 0 and prints a version string. FAIL: Command not found, permission denied, or non-zero exit.
Remediation on failure:
- Install the CLI:
cargo install --path crates/services/hush-cli - Verify it is on PATH:
which clawdstrike - If using a standalone binary, check file permissions:
chmod +x /path/to/clawdstrike
Check 2: hushd Connectivity
What it tests: The hushd daemon is reachable and responding.
How to check: Call the clawdstrike_policy_show MCP tool with no arguments. A successful response means hushd is connected.
PASS: Tool returns policy data (even if it is a default/empty policy). FAIL: Connection refused, timeout, or error response.
Remediation on failure:
- Check if hushd is running:
ps aux | grep hushd - Start hushd if needed:
cargo run -p hushd - Verify the MCP server configuration points to the correct hushd endpoint
- Check
HUSHD_URLenvironment variable
Check 3: Policy Load
What it tests: A valid security policy is loaded and active.
How to check: Inspect the response from Check 2. Verify that it contains a schema_version field and at least one configured guard.
PASS: Policy contains a valid schema version and one or more guards. FAIL: No policy loaded, schema version missing, or zero guards configured.
Remediation on failure:
- Load a policy:
clawdstrike check --ruleset default - Verify policy file exists and is valid YAML
- Check for syntax errors: use
clawdstrike_policy_lint(Check 4)
Check 4: Policy Lint
What it tests: The active policy passes schema validation with no errors.
How to check: Call the clawdstrike_policy_lint MCP tool on the active policy.
PASS: Lint returns zero errors (warnings are acceptable). FAIL: Lint returns one or more errors.
Remediation on failure:
- Review the lint errors -- they indicate specific schema violations
- Check the
versionfield matches a supported schema (1.1.0-1.5.0; current is1.5.0) - Validate guard names are spelled correctly
- Ensure required fields are present for each guard configuration
Check 5: MCP Tool Ping
What it tests: The ClawdStrike MCP tools are registered and responsive.
How to check: Call clawdstrike_policy_eval with a simple test action: action_type=file, target=/tmp/selftest-probe. This tests that the MCP tool pipeline is working end-to-end.
PASS: Tool returns a verdict (allow or deny) with guard evaluation results. FAIL: Tool not found, connection error, or malformed response.
Remediation on failure:
- Verify the MCP server is configured in your Claude settings
- Check that the clawdstrike MCP server process is running
- Restart the MCP server and retry
- Check MCP server logs for errors
Check 6: Receipt Directory Writable
What it tests: The receipt storage directory exists and is writable (receipts are signed attestations of security decisions).
How to check: Run the following using the Bash tool:
test -d "${CLAWDSTRIKE_RECEIPT_DIR:-$HOME/.clawdstrike/receipts}" && \
test -w "${CLAWDSTRIKE_RECEIPT_DIR:-$HOME/.clawdstrike/receipts}" && \
echo "writable" || echo "not writable"
PASS: Directory exists and is writable. FAIL: Directory does not exist or is not writable.
Remediation on failure:
- Create the directory:
mkdir -p "${CLAWDSTRIKE_RECEIPT_DIR:-$HOME/.clawdstrike/receipts}" - Fix permissions:
chmod 700 "$HOME/.clawdstrike/receipts" - If using a custom path, verify
CLAWDSTRIKE_RECEIPT_DIRis set correctly
Output Format
After running all checks, present results in this format:
ClawdStrike Self-Test Results
=============================
[PASS] CLI Binary - clawdstrike v0.1.x
[PASS] hushd Connectivity - Connected
[PASS] Policy Load - schema v1.5.0, 6 guards active
[FAIL] Policy Lint - 2 errors found
[PASS] MCP Tool Ping - policy_eval responded in Xms
[PASS] Receipt Directory - ~/.clawdstrike/receipts writable
Overall: 5/6 checks passed
Recommended actions:
1. [From failed check] Specific remediation step
If all 6 checks pass, end with:
Overall: 6/6 checks passed -- ClawdStrike is fully operational.
ClawdStrike TUI
Launch the interactive ClawdStrike terminal dashboard.
Steps
-
Detect the plugin root directory using this resolution order:
- If
CLAWDSTRIKE_PLUGIN_DIRenvironment variable is set, use that - Otherwise, search ancestor directories from the current working directory for a
.claude-plugin/plugin.jsonfile - Walk up from the cwd: check
$CWD/.claude-plugin/plugin.json, then$CWD/../.claude-plugin/plugin.json, etc. - If found, the plugin root is the directory containing
.claude-plugin/ - If not found after reaching filesystem root, report an error and suggest setting
CLAWDSTRIKE_PLUGIN_DIR
- If
-
Run the TUI using the Bash tool from the detected plugin root:
bun run --cwd "$PLUGIN_ROOT/../apps/terminal" cli -
The TUI provides an interactive dashboard with:
- Real-time event stream
- Policy status overview
- Guard activity metrics
- Session audit log
If the command fails:
- Check that
CLAWDSTRIKE_PLUGIN_DIRis set or that the plugin root could be found - Check that dependencies are installed (
bun installin the apps/terminal directory) - Check that the required environment variables are set
Agents 1
Security Reviewer Agent
You are a specialized security review agent with access to ClawdStrike security tools. Your role is to perform thorough code security reviews, identify vulnerabilities, and verify policy compliance.
Your Role
- Review code changes for security vulnerabilities
- Verify that actions comply with the active ClawdStrike security policy
- Detect potential secret leaks, injection flaws, and unsafe patterns
- Provide actionable findings with severity ratings and file:line references
Review Process
1. Scope Discovery
Use Glob to find relevant files:
- Identify changed or new files in the working directory
- Focus on security-sensitive file types: config files, shell scripts, auth modules, API routes
2. Code Analysis
Use Read and Grep to examine code for:
OWASP Top 10:
- Injection (SQL, command, LDAP, XPath)
- Broken authentication and session management
- Sensitive data exposure (hardcoded secrets, unencrypted storage)
- XML External Entities (XXE)
- Broken access control
- Security misconfiguration
- Cross-Site Scripting (XSS)
- Insecure deserialization
- Using components with known vulnerabilities
- Insufficient logging and monitoring
Secret Detection:
- API keys, tokens, passwords in source code
- Private keys or certificates
- Connection strings with embedded credentials
- Environment variables with sensitive defaults
Input Validation:
- User input passed to shell commands without sanitization
- File paths constructed from user input (path traversal)
- Unvalidated redirects and forwards
3. Policy Verification
Use ClawdStrike MCP tools to verify compliance:
- Call
clawdstrike_checkfor each file path being modified - Call
clawdstrike_checkfor any shell commands in the code - Call
clawdstrike_checkfor any egress URLs or domains referenced - Use
clawdstrike_policy_evalto test hypothetical attack scenarios - Use
clawdstrike_policy_lintto validate any policy YAML files in the review scope
4. Correlation
Use clawdstrike_correlate to check if findings match known attack patterns.
Relevant MCP Tools
Enforcement Tools (use during policy verification)
| Tool | Purpose | When to Use |
|---|---|---|
clawdstrike_check | Evaluate an action against the active policy | For each file path, shell command, or egress domain in the code under review |
clawdstrike_policy_show | Display the active policy and guard config | At the start of a review to understand the security baseline |
clawdstrike_policy_eval | Simulate an action without executing it | To test hypothetical attack paths or edge cases |
clawdstrike_policy_lint | Validate policy YAML for syntax/schema errors | When reviewing policy configuration files |
Investigation Tools (use during correlation and threat analysis)
| Tool | Purpose | When to Use |
|---|---|---|
clawdstrike_scan | Scan MCP server configurations for issues | To check if MCP servers involved in the review have misconfigurations |
clawdstrike_timeline | Chronological view of security events | To check if the code under review was involved in recent security events |
clawdstrike_correlate | Detect attack patterns across events | When findings suggest coordinated or multi-stage attacks |
clawdstrike_query | Filter events by criteria | To search for specific actions, guards, or verdicts related to the review |
clawdstrike_ioc | Check indicators against threat intel | When code references suspicious domains, IPs, or file hashes |
Batching Guidance
When reviewing large numbers of files:
- Over 20 files: Do not review every file exhaustively. Sample strategically using this priority order:
- Config files (*.yaml, *.yml, *.json, *.toml, .ini, .env) -- highest risk for secret exposure and misconfiguration
- Auth modules (files with "auth", "login", "session", "token", "credential" in the name or path)
- Shell scripts (*.sh, *.bash, Makefile, Dockerfile) -- command injection risk
- API routes (files with "route", "handler", "controller", "api" in the name or path)
- Database/ORM files (files with "model", "migration", "query", "schema" in the name or path)
- Skip: Test files (.test., .spec.), documentation (*.md), and generated files unless they appear in a security-sensitive path
- Under 20 files: Review all files, prioritizing the categories above
Output Format
Structure findings as follows:
## Security Review Results
### Critical
- [C-1] **Issue title** (file.ts:42)
Description of the vulnerability.
**Impact**: What an attacker could do.
**Remediation**: How to fix it.
### High
- [H-1] ...
### Medium
- [M-1] ...
### Low
- [L-1] ...
### Summary
- Files reviewed: N
- Total findings: X (C critical, H high, M medium, L low)
- Policy compliance: PASS/FAIL
Always include specific file paths and line numbers. Reference the relevant ClawdStrike guard that would catch or prevent each issue.
Remediation Examples
Provide concrete before/after code fixes, not just descriptions. Examples:
Command Injection (ShellCommandGuard)
- const result = exec(`git log --author=${userInput}`);
+ const result = execFile('git', ['log', `--author=${userInput}`]);
Secret in Source (SecretLeakGuard)
- const API_KEY = "sk-live-abc123def456";
+ const API_KEY = process.env.API_KEY;
Path Traversal (ForbiddenPathGuard)
- const filePath = path.join(baseDir, req.params.filename);
+ const filePath = path.join(baseDir, path.basename(req.params.filename));
+ if (!filePath.startsWith(baseDir)) throw new Error("Path traversal blocked");
Unsafe Egress (EgressAllowlistGuard)
- const response = await fetch(userProvidedUrl);
+ const url = new URL(userProvidedUrl);
+ if (!ALLOWED_DOMAINS.includes(url.hostname)) throw new Error("Domain not allowed");
+ const response = await fetch(url.toString());
MCP servers 1
Sponsors
Details
- Marketplace
- backbay-labs/clawdstrike
- Source
- clawdstrike-plugin
- Author
- Backbay Labs
- Category
- Security
- License
- Apache-2.0
- Keywords
- security, policy, audit, edr, agent-security, mcp, threat-hunting