LOCAL GUARDRAILS FOR AI CODING AGENTS
Catch risky actions.
Keep your agent moving.¶
Check proposed file changes and shell commands while your agent works. Block detected secret writes, flag risky operations, and send useful feedback straight back to the agent.
Python 3.11+ · Local checks · No account required for offline rules
A blocked mistake should have a next step¶
01 / PROPOSE
The agent proposes a write¶
A credential is about to land in a source file. A supported pre-tool hook sends the proposal to AgentLint.
02 / CHECK
AgentLint returns a reason¶
The no-secrets rule denies the write and tells the agent to use an environment variable.
03 / REVISE
The agent can correct it¶
The revised proposal is checked again. Resolving one finding does not bypass the rest of the policy.
A finding gives the agent a concrete correction:
[no-secrets] Secret assignment detected: api_key=...
-> Use environment variables instead of hard-coded secrets.
The agent can propose this instead:
import os
api_key = os.environ["SERVICE_API_KEY"]
This illustrates a standard pre-tool check, not a guarantee that every integration sees every action. Coverage and limitations explains the boundary.
Start in your repository¶
Install using uv or pipx, then connect the agent you use:
uv tool install agentlint
cd your-project
agentlint setup claude
Choose codex, cursor, gemini, continue, kimi, or grok for another native integration. Restart or reload your agent; Codex also requires reviewing and trusting the hooks in /hooks. Make one tool call, then check observation:
agentlint status
Look for a recent observed hook call from this project. Follow the quickstart for the smoke check, first correction, and expected results.
Choose the next guide¶
Connect your agent¶
Install hooks, activate them, and verify that calls reach AgentLint.
Set your project policy¶
Use project policy without turning normal development into a series of exceptions.
Checks that fit your project¶
| With standard severity | Typical behavior |
|---|---|
| Core pre-tool rules | Block detected secret writes, plain protected-branch force-pushes, and unapproved CI edits or package publishing |
| Advisory rules | Warn on many destructive commands, test weakening, and other risky patterns |
| Language/framework packs | Add stack-specific checks when detected or explicitly enabled |
security pack |
Opt-in restrictions for shell file writes and network exfiltration patterns |
autopilot pack |
Opt-in, experimental infrastructure and production checks |
AgentLint includes 77 built-in rules in 8 packs. Some checks happen after edits or at session end; they cannot undo work. Feed-backed rules use optional cloud data. See the rule reference for events, severities, examples, and options.
Agents¶
| Agent or framework | Integration | Start here |
|---|---|---|
| Claude Code | Native hooks; optional marketplace wrapper | Claude guide |
| Codex | Native hooks, including multi-file apply_patch inspection |
Codex guide |
| Cursor | Native tool, shell, and file hooks | Cursor guide |
| Gemini CLI | Native before/after tool hooks | Gemini guide |
| Continue, Kimi, Grok | Native hook adapters | Continue · Kimi · Grok |
| OpenAI Agents SDK | Guardrails attached to supported tools in your code | SDK guide |
| MCP hosts | On-demand, advisory checks | Host setup |
| Your own framework | JSON decisions or Python embedding; you enforce the result | Generic integration |
Watch the walkthrough¶
53 seconds: a proposed mistake, a blocked write, a correction, and setup. Synthetic operations are evaluated as data; dangerous commands are never executed.
Using AgentLint¶
- Rules — what triggers each check and how to respond
- Configuration — packs, severity, paths, and exceptions
- Approvals and evidence — human decisions and verification receipts
- Diagnostics — check observation and investigate a finding
- CI — check file changes on pull requests
- MCP server — check content, patches, and events on demand
- AgentChute — optional cloud features and what is sent
- CLI reference — generated command and option reference
Extending AgentLint¶
Start with a custom rule for a repository convention. Use custom adapters to connect a new host, architecture to understand the engine, and subagent safety when configuring delegated work.
AgentLint uses rules and heuristics. It can miss behavior, flag legitimate actions, and be bypassed by a process with broad access. Keep code review, tests, CI, and least-privilege credentials in place. Understand the security boundary.
Read more¶
- Catch risky AI coding actions before they reach your repository — the action and feedback loop.
- Your coding agent needs a stopping rule — completion contracts and bounded repairs with ConstraintLoop.
- Your AI agent says it's done. What proves it? — verification through delivery and acceptance.