For the complete documentation index, see llms.txt. This page is also available as Markdown.

Guardrails on your computer

What the Guardrails plugin installs and does during a Claude Code session.

Claude Code installs the plugin through your organization's managed settings. Guardrails keeps its local program, computer credential, repository mappings, downloaded rules, and queued event details in ~/.konvu/guardrails/. The rules contain patterns to match and advice to show Claude. Checks run on your computer, and edited code stays there.

Explore the local folder

This is what Guardrails stores locally. Select a file in the tabs below to inspect it.

~/.konvu/guardrails
guardrails/
├── bin/
│   ├── v0.6.38/
│   │   └── guardrails
│   └── current
├── profiles/
│   └── <repository-id>/
│       ├── triggers.json
│       └── sync.json
├── repos.json
├── credentials.json
└── queue.jsonl

profiles/<repository-id>/triggers.json holds matching patterns and advice for that repository. Guardrails checks for updated rules at session start.

{
  "triggers": [
    {
      "id": "invoice-org-scope",
      "matches": "content",
      "files": ["billing/views.py"],
      "patterns": ["Invoice\\.query\\.get_or_404\\("],
      "tokens": [{
        "pattern": "Invoice\\.query\\.get_or_404\\(",
        "paths": ["billing/views.py"]
      }],
      "text": "Scope invoice lookups to the signed-in user's organization. Use Invoice.for_org(current_user.org).get_or_404(id)."
    }
  ]
}

profiles/<repository-id>/sync.json records when rules for this repository were last fetched.

{
  "repository_id": "billing-app",
  "fetched_at": 1791547200
}

repos.json maps Git remotes and local checkouts to repository IDs, so each file is checked against the right rules.

credentials.json stores this computer's own credential for Konvu. Guardrails creates it with private file permissions; the deployment key is only needed to enroll.

queue.jsonl holds rule events until Guardrails sends them to Konvu at the end of a turn. Records include the rule, decision, and relative file path, not edited code. One line is expanded below for readability.

bin/v0.6.38/guardrails is the verified Rust CLI. Claude Code hooks call it to sync rules and check edits; the plugin does not download it for every edit. bin/current holds the installed version name.

The local footprint is small. On one Mac, the folder used about 14 MB, including roughly 10 MB for the CLI. The size varies with the number of repositories and rules.

During a Claude Code session

Claude Code calls Guardrails automatically during a session. This example follows an invoice edit from authentication through guidance, a file check, and sending event details.

Claude Code terminal with an invoice edit corrected after Guardrails advice. Arrows connect session start, before edit, after edit, and end output to explanation cards on the right.

The walkthrough shows four points in the session:

  • Session start: A background task checks the local program, authenticates the computer, and refreshes downloaded rules. It fetches the current repository first, then other mapped repositories.

  • Before an edit: The hook reads those rules locally. It can hold the first write so Claude sees the matching advice before retrying.

  • After an edit: The local program scans the saved file and tells Claude about new risky patterns.

  • End of turn: Guardrails tries to send queued rule events to Konvu in the background. The events do not contain edited code.

The plugin also runs a hook when Claude submits a prompt, and clears local session state when the session ends. The walkthrough focuses on file edits. If the local program or rules are unavailable, Claude Code continues.

What the plugin installs

The plugin itself is a small set of Claude Code hook scripts. At session start, it installs or verifies a pinned Rust Guardrails CLI for the computer's platform. It checks the archive and executable against their checksums before storing the executable under ~/.konvu/guardrails/bin/. Later hooks call that local executable; they do not download it for every edit.

The CLI exchanges the deployment key for this computer's own credential, matches the repository to its downloaded rules, runs the local checks, and queues rule events for delivery to Konvu. It keeps the computer credential in a private file under ~/.konvu/guardrails/.

Read more

Security guidance at the edit

KONVU BLOG

Steer in the session, enforce at the PR: how Konvu Guardrails works

From repository Controls to local guidance and a pull request check.

Last updated