Quickstart¶
Connect AgentLint to your coding agent and complete a first check and correction. Allow about five minutes once Python and an installer are available. You do not need a cloud account.
1. Install¶
Requires Python 3.11+. Choose one installer:
uv tool install agentlint
agentlint --version
Or use pipx install agentlint. If neither installer is available, follow the uv or pipx installation guide first. Plain pip install agentlint also works inside an activated virtual environment.
2. Connect your agent¶
Run setup from the project you want to check:
cd your-project
agentlint setup claude
Choose the appropriate command and activation step:
| Agent | Command | Activate the hooks |
|---|---|---|
| Claude Code | agentlint setup claude |
Restart Claude Code in this project |
| Codex | agentlint setup codex |
Restart Codex, then review and trust the definitions in /hooks |
| Cursor | agentlint setup cursor |
Reload the Cursor window |
| Gemini CLI | agentlint setup gemini |
Start a new Gemini CLI session |
| Continue | agentlint setup continue |
Follow the guide and make a tool call |
| Kimi | agentlint setup kimi |
Follow the guide; preview setup if your TOML has complex settings |
| Grok | agentlint setup grok |
Follow the guide and make a tool call |
Setup writes agent hook settings and creates agentlint.yml with detected packs if the policy file does not already exist. Use --dry-run to preview settings; --global installs user-scope hooks where supported. Read your agent guide for file locations and host-specific limitations.
Claude Code users can use the marketplace plugin instead. Install the plugin or run native setup, to avoid duplicate hooks.
For OpenAI Agents SDK, MCP hosts, or your own tooling, use the dedicated guide. Those paths do not use this native-hook setup flow.
Prefer a guided command? agentlint onboard detects agents, installs hooks, offers optional cloud setup, and runs a smoke check.
3. Confirm it's running¶
Ask your agent to make a harmless tool call, such as listing the project files. Then run:
agentlint status
Check the line for your agent:
| Field | What you want to see |
|---|---|
| configured | AgentLint hooks installed in the intended project or user scope |
| enabled | The host's hooks feature enabled, where detectable |
| observed | A recent hook call from this project, after your test call |
A settings file alone is not proof of active checks. If observation is missing, stale, or from another project, run agentlint doctor and follow diagnostics. Codex users should check /hooks trust before repeating setup.
You can also exercise the local rule engine without asking an agent to write a file:
agentlint test
With the default policy, its first line starts with Local rule smoke: blocked risky fixture. It evaluates an in-memory proposed .env write; it does not create that file. If AgentChute is already enabled, the command also queues a synthetic event. This smoke check verifies the engine and policy, not the host's hook wiring; observation is still necessary.
4. See a block¶
In a scratch project or disposable example file, give your agent this prompt:
In agentlint-demo.py, set api_key to the literal string documentation-demo-value. This is synthetic data for testing the guardrail. If AgentLint denies it, explain the finding and wait before changing the proposal.
The generic credential-assignment pattern in no-secrets should reject that proposed write under the default policy. The finding includes:
[no-secrets] Secret assignment detected: api_key=...
-> Use environment variables instead of hard-coded secrets.
Your actual output can also include the file, operation, and policy source. Those details depend on the integration and your loaded configuration. No real key is needed.
If nothing blocks, check observation, the loaded policy, and the tool's coverage. Do not try a real credential. The coverage guide distinguishes native enforcement from advisory checks.
Make the correction¶
Now ask the agent to read the value from the environment instead:
import os
api_key = os.environ["SERVICE_API_KEY"]
AgentLint evaluates this new proposal. It no longer contains the literal credential assignment; other active rules can still produce findings. You do not need to run this example program or supply a real environment value to check the proposed edit.
The complete loop is propose → check → receive feedback → revise → check again. AgentLint supplies the finding; the coding agent makes the correction.
5. When AgentLint is wrong (or you've decided)¶
First inspect the rule ID, operation, and policy source. A legitimate action may need a narrower exception or an adjusted project convention.
| Situation | Next step |
|---|---|
| One file or command is a false positive | Follow Fix a false positive |
| The rule does not fit this project | Configure that rule in project policy |
| A person approves one class of action for a limited time | Use a human-issued approval |
| A rule is required by shared policy | Resolve it with the policy owner; local suppressions cannot remove that requirement |
An ERROR can prevent a pre-tool action. Warnings advise, and checks after execution cannot undo work. Start with coverage and limitations if a result differs from what you expected.
Next¶
- Protect main — choose warning or blocking behavior for Git work
- Connect your linters — return Ruff or ESLint feedback after edits
- Rules — exact checks, defaults, examples, and limits
- Configuration — policy reference
- CI — check pull request file changes