About RuleDrift
RuleDrift is a local test suite for checking whether AI agents keep following critical instructions as conversations grow. It is for developers testing changes to prompts, models, memory systems, or agent workflows.
Key features
- 01Finds the first point where a rule fails
- 02Terminal, JSON, and JUnit reports
- 03Local Ollama and custom-agent support
- 04Stable exit codes for CI
- 05Optional MCP tools for coding clients
Use cases
- 01Test instruction retention after prompt changes
- 02Check agent behavior across long conversations
- 03Run rule checks in CI
MCP support
RuleDrift provides optional MCP tools for AI coding clients. Start the MCP server with `npx -y rule-drift mcp --root /path/to/your/project`.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
2Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| configPath | string | No | Configuration path inside the MCP workspace root. |
Details
From the project READMERuleDrift
Catch the moment your agent drifts from its rules.
RuleDrift tests whether an AI agent still follows important instructions after a conversation becomes long or distracting.
Run it like a test suite when you change a prompt, model, memory system, or agent workflow. It runs locally and does not sit in front of production requests.
Quick start
Requires Node.js 22+ and Ollama.
ollama pull qwen3:1.7b
npx rule-drift init
npx rule-drift test
No paid model API, account, backend, or telemetry is required.
What you get
- The first conversation point where a rule fails
- Terminal, JSON, and JUnit reports
- Local Ollama and bring-your-own-agent support
- Optional MCP tools for AI coding clients
- Stable exit codes for CI
MCP
npx -y rule-drift mcp --root /path/to/your/project
See the MCP setup guide for client configuration and safety details.
Documentation
Contributions are welcome—see CONTRIBUTING.md. Licensed under MIT.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.