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@clawdstrike

Run it inside Claude Code after adding the marketplace with /plugin marketplace add backbay-labs/clawdstrike.

Contents

Discovered from source

Skills 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

GuardAction TypePurposeDefault Status
ForbiddenPathGuardfileBlocks access to sensitive filesystem paths (e.g., /etc/shadow, ~/.ssh/id_rsa)permissive: ON, default: ON, strict: ON
PathAllowlistGuardfileOnly allows file access to explicitly permitted pathspermissive: OFF, default: OFF, strict: ON
EgressAllowlistGuardegressControls outbound network access by domain allowlistpermissive: OFF, default: ON, strict: ON
SecretLeakGuardfileDetects secrets, API keys, and credentials in file writespermissive: ON, default: ON, strict: ON
PatchIntegrityGuardfileValidates that patches/diffs don't introduce unsafe changespermissive: OFF, default: ON, strict: ON
ShellCommandGuardshellBlocks dangerous shell commands (rm -rf, sudo, etc.)permissive: OFF, default: ON, strict: ON
McpToolGuardmcp_toolRestricts which MCP tools can be invokedpermissive: OFF, default: OFF, strict: ON
PromptInjectionGuardpromptDetects prompt injection attempts in inputspermissive: OFF, default: ON, strict: ON
JailbreakGuardprompt4-layer jailbreak detection (heuristic + statistical + ML + LLM-judge)permissive: OFF, default: OFF, strict: ON
ComputerUseGuardcomputer_useControls Computer Use Agent actions for remote desktoppermissive: OFF, default: OFF, strict: ON
RemoteDesktopSideChannelGuardremote_desktopSide-channel controls (clipboard, audio, drive mapping, file transfer)permissive: OFF, default: OFF, strict: ON
InputInjectionCapabilityGuardcomputer_useRestricts input injection capabilities in CUA environmentspermissive: OFF, default: OFF, strict: ON

Available Rulesets

Use clawdstrike_policy_show to inspect any ruleset.

RulesetUse Case
permissiveDevelopment/testing -- minimal restrictions
defaultGeneral purpose -- balanced security
strictHigh-security environments -- maximum restrictions
ai-agentAI coding agents -- tuned for agent workflows
cicdCI/CD pipelines -- restricted to build/deploy operations
ai-agent-postureAgent posture assessment -- monitoring without blocking
remote-desktopRemote desktop sessions -- balanced CUA controls
remote-desktop-permissivePermissive CUA -- fewer restrictions for trusted environments
remote-desktop-strictStrict 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:

  1. Identify the blocking guard: Call clawdstrike_policy_eval with the denied action to see exactly which guard is blocking it.
  2. Check if the action is expected: Verify the action is genuinely needed and not a misconfigured command or wrong path.
  3. Try a less restrictive ruleset: If on strict, try default or ai-agent. Use clawdstrike_policy_show to compare what changes.
  4. 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"
    
  5. Add path-specific exceptions: For file guards, add paths to allowlists rather than disabling the guard entirely.
  6. Disable a single guard as last resort: Set enabled: false for a specific guard only if the above options do not work. Never disable SecretLeakGuard in production.
  7. Re-verify: After changes, run clawdstrike_policy_eval again to confirm the action is now allowed without opening unintended gaps.

Response Guidelines

When this skill is active:

  • Use clawdstrike_policy_show and clawdstrike_policy_eval to 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:

  1. Pre-flight check: Call clawdstrike_check with the action_type and target before executing
  2. Secret scanning: Verify no secrets, API keys, or credentials are being written to files
  3. Dependency audit: For new dependencies, check for known vulnerabilities
  4. Permission scope: Ensure file operations stay within allowed paths
  5. Shell safety: Validate shell commands against the ShellCommandGuard policy

Action Type Mapping

Use these action_type values when calling clawdstrike_check:

Scenarioaction_typetarget
Writing/reading filesfileAbsolute file path
Running shell commandsshellThe command string
HTTP/network requestsegressDomain or URL
Installing packagesshellInstall command
MCP tool invocationmcp_toolTool name

Response Guidelines

When this skill is active:

  • Proactively call clawdstrike_check before 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:

ToolWhen to Use
clawdstrike_checkBefore any file write, shell command, or egress -- the primary enforcement tool
clawdstrike_policy_evalTo test hypothetical actions without executing them -- use for planning
clawdstrike_policy_showTo understand which guards are active and what the current restrictions are
clawdstrike_scanTo audit all MCP server configs for misconfigurations before a review
clawdstrike_policy_lintTo 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 behavior

Investigation 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:

TechniqueIDIndicators
Command and Scripting InterpreterT1059Shell commands with encoded payloads, eval/exec usage
File and Directory DiscoveryT1083Enumeration of sensitive directories
Exfiltration Over Web ServiceT1567Egress to uncommon domains after file reads
Credential AccessT1552Access to .env, .ssh, credential files
Defense EvasionT1562Attempts to modify security config or disable guards
PersistenceT1546Modifications to shell profiles, cron, startup files
Privilege EscalationT1548sudo/chmod/chown commands, setuid changes

MITRE Technique to MCP Tool Mapping

Use this table to select the right investigation tool for each technique:

MITRE TechniqueIDPrimary MCP ToolInvestigation Approach
Command and Scripting InterpreterT1059clawdstrike_queryFilter by action_type=shell, look for encoded payloads or eval/exec
File and Directory DiscoveryT1083clawdstrike_timelineBroad timeline scan for sequential file reads across sensitive dirs
Exfiltration Over Web ServiceT1567clawdstrike_correlateCorrelate file reads followed by egress to uncommon domains
Credential AccessT1552clawdstrike_queryFilter by action_type=file targeting .env, .ssh, credential paths
Defense EvasionT1562clawdstrike_queryFilter for policy modification attempts or guard config changes
PersistenceT1546clawdstrike_iocCheck shell profile, cron, and startup file modifications
Privilege EscalationT1548clawdstrike_queryFilter by action_type=shell for sudo, chmod, chown, setuid

Incident Classification

Classify incidents using these severity levels:

ClassificationCriteriaResponse
P1 - CriticalActive exploitation, data exfiltration confirmed, credential compromiseImmediate remediation, revoke credentials, isolate affected sessions
P2 - HighBlocked exploit attempt, repeated policy violations, suspicious lateral movementInvestigate within current session, tighten policy, monitor for recurrence
P3 - MediumSingle denied action matching known TTP, anomalous but unconfirmed activityLog for review, verify policy coverage, check for related events
P4 - LowInformational anomaly, policy audit events, benign tool misuseDocument 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

  1. Call clawdstrike_timeline MCP tool with the current session context (or the session ID passed as $ARGUMENTS if provided)
  2. Format the results as a chronological table with these columns:
TimestampActionTargetVerdictGuardDetails

Column Meanings

ColumnDescription
TimestampISO-8601 time when the action was evaluated
ActionThe action_type that was checked (file, shell, egress, mcp_tool, prompt, computer_use)
TargetThe specific resource: file path, command string, domain, tool name
VerdictThe enforcement decision: ALLOW, DENY, or AUDIT
GuardThe guard that produced the verdict (or "all" if multiple agreed)
DetailsAdditional context such as matched pattern, denial reason, or evidence snippet
  1. Use these verdict indicators:

    • ALLOW for permitted actions
    • DENY for blocked actions
    • AUDIT for logged-but-allowed actions
  2. 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:

QueryHow to Investigate
All denied actionsFilter the table to Verdict = DENY rows. Look for patterns in targets.
Actions on a specific fileSearch the Target column for the file path. Note the sequence of actions.
Guard-specific activityFilter by Guard column to see all evaluations for a single guard (e.g., SecretLeakGuard).
Escalation attemptsLook for sequences: file reads of credentials followed by shell commands or egress.
High-frequency targetsCount 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

  1. Call clawdstrike_policy_show MCP tool to retrieve the current policy

  2. Present the policy metadata:

    • Policy name and schema version
    • Base ruleset (if using extends)
    • Number of enabled/disabled guards
  3. Format guard configurations as a table:

GuardStatusKey Settings
ForbiddenPathGuardEnabled/DisabledBlocked paths list
PathAllowlistGuardEnabled/DisabledAllowed paths list
EgressAllowlistGuardEnabled/DisabledAllowed domains
SecretLeakGuardEnabled/DisabledDetection patterns
PatchIntegrityGuardEnabled/DisabledValidation rules
ShellCommandGuardEnabled/DisabledBlocked commands
McpToolGuardEnabled/DisabledTool allowlist/denylist
PromptInjectionGuardEnabled/DisabledDetection threshold
JailbreakGuardEnabled/DisabledDetection layers
ComputerUseGuardEnabled/DisabledAllowed actions
RemoteDesktopSideChannelGuardEnabled/DisabledChannel restrictions
InputInjectionCapabilityGuardEnabled/DisabledCapability restrictions
  1. 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:

GuardWhen EnabledWhen Disabled
ForbiddenPathGuardAccess to sensitive paths (e.g., /etc/shadow, ~/.ssh) is blockedAll file paths accessible; rely on OS-level permissions only
PathAllowlistGuardOnly explicitly listed paths are accessible; everything else is deniedFile access governed only by ForbiddenPathGuard (denylist)
EgressAllowlistGuardOnly listed domains can be contacted; all other egress is blockedUnrestricted outbound network access
SecretLeakGuardFile writes are scanned for secrets; matches are deniedSecrets can be written to files without detection
PatchIntegrityGuardPatches/diffs are validated for unsafe patterns before applicationPatches applied without safety checks
ShellCommandGuardDangerous commands (rm -rf, sudo, curl|bash) are blockedAll shell commands allowed without restriction
McpToolGuardOnly allowlisted MCP tools can be invokedAll MCP tools accessible
PromptInjectionGuardInput text is scanned for injection patternsPrompt injection attempts pass through undetected
JailbreakGuardMulti-layer jailbreak detection active (heuristic + statistical + ML + LLM-judge)No jailbreak detection
ComputerUseGuardCUA actions restricted to allowed typesUnrestricted computer use actions
RemoteDesktopSideChannelGuardSide channels (clipboard, audio, drives, file transfer) restrictedNo side-channel controls
InputInjectionCapabilityGuardInput injection capabilities restricted in CUA environmentsUnrestricted 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

  1. Get active policy: Call clawdstrike_policy_show to retrieve the current policy and guard configuration
  2. Scan MCP configs: Call clawdstrike_scan to check all MCP server configurations for issues
  3. Check recent denials: Call clawdstrike_query with verdict=deny to find recent policy violations

Scoring

Assess posture across these categories and assign a sub-grade (A-F) to each:

CategoryWeightWhat to Check
Policy Strength25%Ruleset level (strict > default > permissive), number of enabled guards
MCP Config25%Scan findings -- critical/high issues lower the grade
Violation Rate25%Frequency and severity of recent denials
Coverage25%Guard coverage across action types (file, shell, egress, mcp_tool)

Grade Scale

GradeScore RangeCriteria
A90 - 100Strong security posture, strict policy, no critical findings
B80 - 89Good posture, minor gaps or medium findings
C70 - 79Moderate posture, some high findings or significant gaps
D60 - 69Weak posture, critical findings or major gaps in coverage
F0 - 59Minimal security, permissive policy with unaddressed critical issues

Scoring Examples

Policy Strength (25 points max):

  • strict ruleset with all guards enabled: 25
  • default ruleset with most guards enabled: 20
  • ai-agent ruleset with standard config: 18
  • permissive ruleset: 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

  1. Call the clawdstrike_scan MCP tool to analyze the current MCP server configurations
  2. Group findings by severity level: Critical, High, Medium, Low
  3. 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

SeverityRisk CategoryExamples
CriticalRCE / Arbitrary code executionMCP server with unrestricted shell access, eval-based tool handlers, unsandboxed code interpreters
HighAuth bypass / Secret exposureMissing authentication on MCP endpoints, credentials in server config, overprivileged tool permissions
MediumConfig drift / Overprivileged accessEgress allowlist too broad, file access beyond project scope, deprecated TLS versions
LowInfo disclosure / Best practiceVerbose error messages, missing rate limiting, no audit logging configured

Remediation Priority

Address findings in severity order:

  1. Critical: Fix immediately. These represent active exploitation vectors. Block the affected MCP server until remediated.
  2. High: Fix before next session. These could lead to credential compromise or unauthorized access.
  3. Medium: Fix within the current work cycle. These represent security debt that increases risk over time.
  4. 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_URL environment 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 version field matches a supported schema (1.1.0-1.5.0; current is 1.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_DIR is 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

  1. Detect the plugin root directory using this resolution order:

    • If CLAWDSTRIKE_PLUGIN_DIR environment variable is set, use that
    • Otherwise, search ancestor directories from the current working directory for a .claude-plugin/plugin.json file
    • 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
  2. Run the TUI using the Bash tool from the detected plugin root:

    bun run --cwd "$PLUGIN_ROOT/../apps/terminal" cli
    
  3. 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_DIR is set or that the plugin root could be found
  • Check that dependencies are installed (bun install in 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_check for each file path being modified
  • Call clawdstrike_check for any shell commands in the code
  • Call clawdstrike_check for any egress URLs or domains referenced
  • Use clawdstrike_policy_eval to test hypothetical attack scenarios
  • Use clawdstrike_policy_lint to 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)

ToolPurposeWhen to Use
clawdstrike_checkEvaluate an action against the active policyFor each file path, shell command, or egress domain in the code under review
clawdstrike_policy_showDisplay the active policy and guard configAt the start of a review to understand the security baseline
clawdstrike_policy_evalSimulate an action without executing itTo test hypothetical attack paths or edge cases
clawdstrike_policy_lintValidate policy YAML for syntax/schema errorsWhen reviewing policy configuration files

Investigation Tools (use during correlation and threat analysis)

ToolPurposeWhen to Use
clawdstrike_scanScan MCP server configurations for issuesTo check if MCP servers involved in the review have misconfigurations
clawdstrike_timelineChronological view of security eventsTo check if the code under review was involved in recent security events
clawdstrike_correlateDetect attack patterns across eventsWhen findings suggest coordinated or multi-stage attacks
clawdstrike_queryFilter events by criteriaTo search for specific actions, guards, or verdicts related to the review
clawdstrike_iocCheck indicators against threat intelWhen 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:
    1. Config files (*.yaml, *.yml, *.json, *.toml, .ini, .env) -- highest risk for secret exposure and misconfiguration
    2. Auth modules (files with "auth", "login", "session", "token", "credential" in the name or path)
    3. Shell scripts (*.sh, *.bash, Makefile, Dockerfile) -- command injection risk
    4. API routes (files with "route", "handler", "controller", "api" in the name or path)
    5. Database/ORM files (files with "model", "migration", "query", "schema" in the name or path)
    6. 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