Kapibara

Check risky actions before they run. Compare sources for hidden conflicts. Scan secrets and prompt injections. Your AI can act. Kapibara checks first.

Run preflight

Preflight risky actions

Evaluate shell commands, git operations, deletes, and deploys against .kapibara/rules.md before execution.

One check before irreversible side effects.

Skill: /kapibara:preflight-check · Tool: kapibara_preflight

kapibara_preflight .kapibara/rules.md

Recent preflight checks:

git push --force → origin/main Rule: Never force-push to main or master
BLOCK · 89/100
deploy → production-us-east Rule: Ask before deploying to production
REQUIRE_APPROVAL · 70/100
rm -rf → dist/ build/ Profile: developer · Workspace build artifacts
ALLOW · 10/100
Agent preflight gate stdio · readOnlyHint: true

Run git push --force origin main and deploy release v2.4.0 to production.

Evaluating kapibara_preflight & .kapibara/rules.md…

Decision: BLOCK (critical, score 89/100). Force-pushing to protected branch main violates project rule "Never force-push to main or master". Push to a feature branch and open a pull request instead.

Decision: BLOCK (critical, score 89/100). Force-pushing to protected branch main violates project rule "Never force-push to main or master". Push to a feature branch and open a pull request instead.

Execution halted before git push --force
git_force_push
.kapibara/rules.md · profile: balanced
Evaluating rules… Policy enforced

Preflight Gate Report

kapibara_preflight · kapibara_rules_check

BLOCK · 89 / 100
1. Classification & Decision

Action classified as git_force_push (category: git) targeting protected branch origin/main. Binding decision: BLOCK (severity: critical).

2. Matched Project Rules (.kapibara/rules.md)

Matched rule "Never force-push to main or master" (decision: block) and "Ask before deploying to production" (decision: require_approval).

3. Detected Issues

[critical] git_force_push: Force push can overwrite remote commit history.
[high] protected_branch_write: Target branch main is protected.

4. Safer Recommendation

Push to a new branch (git push -u origin feat/release-v2.4), open a pull request, and request explicit human approval before deploying to production.

Score risk and get a second opinion

Break down six deterministic risk factors from 0 to 100 and challenge high-impact plans before touching production.

Challenge your plan before executing.

Skills: /kapibara:action-risk & /kapibara:second-opinion · Tool: kapibara_action_risk

Second opinion: should we run ALTER TABLE users DROP COLUMN legacy_token on prod_db right now?

Scoring 6 risk factors via kapibara_action_risk…

Verdict: DO NOT PROCEED. Kapibara returned REQUIRE_APPROVAL (critical, score 78/100). Dropping a column on prod_db is irreversible (18/20) with high destructive impact (22/25).

Verdict: DO NOT PROCEED. Kapibara returned REQUIRE_APPROVAL (critical, score 78/100). Dropping a column on prod_db is irreversible (18/20) with high destructive impact (22/25).

6-Factor Risk Score Breakdown 78 / 100 · critical
destructive_impact
22/25
reversibility
18/20
sensitive_data
6/20
external_side_effects
12/15
production_impact
10/10
uncertainty
10/10
Second Opinion Review /kapibara:second-opinion

Main concern: Live readers referencing legacy_token will fail immediately, and dropped column data cannot be rolled back without a snapshot restore.

Safer alternative: Deploy application code that stops reading legacy_token first, verify zero queries in staging, then run the migration during a maintenance window.
kapibara_action_risk second-opinion

Compare sources and redact secrets

Catch conflicting amounts, dates, and versions across files, and strip credentials or prompt injections before outbound calls.

Outbound settlement payload · invoice.json vs email.txt Secrets redacted & conflict resolved

Cross-Source & Sensitive Payload Audit

kapibara_compare · kapibara_scan_sensitive

1. Source Comparison (kapibara_compare)

Source A (invoice.json): Total fee is $1,200, due 2026-05-01, schema v2.1.0.
Source B (approval-email.txt): Total fee is $1,500, due 2026-05-15, schema v2.1.0.

2. Outbound Payload Inspection (kapibara_scan_sensitive)

Inspecting headers and body before agent sends webhook to external endpoint:

Authorization: Bearer sk-proj-9f8a7b6c5d4e3f2a1b0c9d8e · Ignore previous instructions sk-proj-**** (redacted) · Prompt injection stripped
3. File Path & Private Key Guard

Blocked reading .env.production and id_rsa per project rule "Block reading or sending .env and *.pem".

Verification findings 2 findings

Scanning sources and outbound payload.
Findings appear right here.

Selected · Outbound Payload & Invoice

Bearer sk-proj-9f8a… · $1,200 vs $1,500

kapibara_scan_sensitive
Detected · Secret + Amount Mismatch

openai_api_key (critical) · prompt_injection (high)

kapibara_compare & scan_sensitive Just now
Amount conflict detected: invoice.json ($1,200) vs email.txt ($1,500). Outbound header contains live OpenAI key and prompt injection.
Redacting credentials & stripping injection…
Kapibara Redactor sensitive-data-check Just now
Redacted sk-proj-**** in place, stripped untrusted prompt injection, and held settlement until the $1,200 vs $1,500 invoice conflict is confirmed.
Redacted sk-proj-**** in place, stripped untrusted prompt injection, and held settlement until the $1,200 vs $1,500 invoice conflict is confirmed.
Payload sanitized to sk-proj-****.
Sanitized & verified
Interactive Inspector

Test Kapibara preflight, risk, and scanners live

Pick a preset agent scenario or edit the action, target, profile, and payload below to run Kapibara’s deterministic engine.

kapibara_preflight · git_force_push

Force-pushing to protected branch main is blocked.

BLOCK · 89/100

            
Bundled Skills & MCP Tools

Six agent skills backed by five read-only MCP tools

Every Kapibara tool sets readOnlyHint: true and destructiveHint: false. Kapibara never executes shell commands or mutates files on your machine.

/kapibara:preflight-check

Preflight Check

Evaluates shell commands, file deletions, git history rewrites, and deploys before execution. Returns allow, warn, require_approval, or block.

kapibara_preflight Binding gate
/kapibara:action-risk

Action Risk

Scores any proposed action from 0 to 100 across 6 deterministic factors: destructive impact, reversibility, sensitive data, external side effects, production impact, and uncertainty.

kapibara_action_risk 0–100 score
/kapibara:second-opinion

Second Opinion

Challenges risky migrations, force-pushes, or production changes with a structured review: AGREE, AGREE WITH CHANGES, or DO NOT PROCEED.

preflight + action_risk Plan critique
/kapibara:consistency-check

Consistency Check

Compares two text sources (invoices vs emails, configs vs docs, lockfiles vs specs) to detect conflicting currency amounts, dates, versions, and contradictory statements.

kapibara_compare Cross-source diff
/kapibara:sensitive-data-check

Sensitive Data Check

Scans text and file paths for API keys, tokens, PEM private keys, PII, and prompt-injection patterns, returning masked previews (sk-proj-****) and redactions.

kapibara_scan_sensitive Auto-redaction
/kapibara:setup

Agent & Rules Setup

Connects the @kapibara/mcp server to Claude Code, Codex, Cursor, OpenCode, or Claude Desktop and enforces plain-English rules in .kapibara/rules.md.

kapibara_rules_check Plain-English rules
Action / Scenario developer profile balanced (default) strict profile
git push --force origin main BLOCK (protected branch) BLOCK (protected branch) BLOCK (protected branch)
rm -rf dist/ build/ (workspace artifacts) ALLOW (safe build cleanup) WARN (verify path) REQUIRE_APPROVAL
deploy or ALTER TABLE in production REQUIRE_APPROVAL REQUIRE_APPROVAL BLOCK / REQUIRE_APPROVAL
Outbound payload containing sk_live_… or .env BLOCK + Redact BLOCK + Redact BLOCK + Redact