The Active Reliability Layer for AI Agents
Project description
Steer
The Active Reliability Layer for AI Agents.
Stop debugging. Start teaching.
Steer turns runtime hallucinations into permanent fixes instantly.
Mission Control: Catching hallucinations locally and fixing them with one click.
The Problem: The Agent Lobotomy
Most developers are forced to "lobotomize" their agents in production (stripping autonomy, hardcoding paths, and removing tools) because they cannot verify probabilistic output. When an agent fails, simply logging the error is insufficient. You are usually forced to:
- Dig through logs to find the specific prompt.
- Edit your prompt template manually.
- Redeploy the application to fix a single edge case.
The Solution: Reality Locks
Steer wraps your agent functions with deterministic Reality Locks. When a failure is detected, Steer blocks the output and logs it to a local dashboard. You provide a correction via the UI, and Steer injects that rule into the agent context at runtime without a code change.
Stop lobotomizing your agents. Reality Locks allow you to keep the intelligence while the code enforces the boundaries.
Installation
pip install steer-sdk
Quickstart
Generate the example scripts to see the workflow in action.
Note: Ensure you run all commands from the same directory so the local database remains synced.
steer init
# Generates 01_structure_guard.py, 02_safety_guard.py, etc.
steer ui
# Starts the local dashboard at http://localhost:8000
Run a demo (from the same folder used to run ui command):
- Fail: Run
python 01_structure_guard.py. The output will show[-] Status: Blocked. - Teach: Go to
http://localhost:8000. Click the red incident, select Teach, and save the Strict JSON rule. - Fix: Run
python 01_structure_guard.pyagain. The output will now show[+] Status: Passed.
## Reality Locks in Action
The Steer workflow follows a simple loop: **Catch → Teach → Fix.**
### 1. Structure Guard (JSON)
**Problem:** Agent wraps JSON in Markdown backticks, breaking your parser.
**Fix:** Block the output and enforce raw JSON formatting.

### 2. Safety Guard (PII)
**Problem:** Agent accidentally leaks customer emails or internal keys.
**Fix:** Block the response and enforce redaction protocols.

### 3. Logic Guard (Ambiguity)
**Problem:** Agent guesses a city (e.g., Springfield, IL) instead of asking for clarification.
**Fix:** Force the agent to ask the user clarifying questions.

### 4. Slop Filter (Brand Voice)
**Problem:** Agent uses "AI-voice" (emojis, em dashes, apologies) that signals uncurated slop.
**Fix:** Block LLM fingerprints and enforce a blunt, professional signal.

## Cookbook
Explore the `cookbook/` directory for enterprise-grade implementations.
### RAG Reliability
Demonstrates how to enforce strict data schemas and grounding citations in a RAG pipeline.
* **Pydantic Schema Enforcement:** Ensuring the agent always returns a valid, typed data structure.
* **Citation Verification:** Hard-locking the agent to cite its sources, preventing ungrounded claims.
[View RAG Cookbook](https://github.com/imtt-dev/steer/blob/main/steer/cookbook/rag_reliability.py)
## Integration
Add `steer_rules` to your function arguments. Steer populates this automatically via dependency injection.
```python
from steer import capture
from steer.verifiers import JsonVerifier
# 1. Define Reality Locks
json_check = JsonVerifier(name="Strict JSON")
# 2. Decorate your Agent Function
@capture(verifiers=[json_check])
def my_agent(user_input, steer_rules=""):
# Rules are injected automatically at runtime.
# Update agent behavior from the dashboard without a code redeploy.
system_prompt = f"You are a helpful assistant.\n{steer_rules}"
# ... Your LLM call ...
return llm.call(system_prompt, user_input)
Data Engine: Synthetic Data for DPO
Steer transforms runtime failures into a competitive asset. By capturing the delta between a Blocked Response (the hallucination) and the Taught Response (the correction), Steer generates contrastive pairs for Direct Preference Optimization (DPO).
Export Training Data
Run this command to generate a dataset ready for trl, unsloth, or OpenAI fine-tuning:
# Export successful runs for SFT
steer export --format openai
# Export contrastive pairs (Rejected vs Chosen) for DPO
steer export --format dpo
DPO Output Schema:
{
"prompt": "Create admin profile for user u-8821",
"chosen": "{\n \"id\": \"u-8821\",\n \"status\": \"active\"\n}",
"rejected": "```json\n{\n \"id\": \"u-8821\",\n \"status\": \"active\"\n}\n```"
}
What is the "Confident Idiot" Problem?
The Confident Idiot is a failure mode where an LLM generates a factually incorrect or structurally broken response with high probability (confidence). Because LLMs fail silently and plausibly, traditional observability is insufficient. Steer provides the verification layer to catch these failures before they hit your users.
Read the viral discussion on Hacker News.
Star History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file steer_sdk-0.3.1.tar.gz.
File metadata
- Download URL: steer_sdk-0.3.1.tar.gz
- Upload date:
- Size: 459.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.9 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b292b7593515da760f9a10d3a49220134a03debba9c97876c411fdea121c9b47
|
|
| MD5 |
cc866f531933577d9f5981d484dadfe8
|
|
| BLAKE2b-256 |
f6ecd8f5f8e04f542fffb888787a0714dd4824e6feb309e4bdf775da97216191
|
File details
Details for the file steer_sdk-0.3.1-py3-none-any.whl.
File metadata
- Download URL: steer_sdk-0.3.1-py3-none-any.whl
- Upload date:
- Size: 476.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.9 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57d2b5b6e593722741a89438339f4fb3fa531b150a29ff11000ba77ac8800b47
|
|
| MD5 |
f1523b25379ebce2c8271aa4137d5b66
|
|
| BLAKE2b-256 |
3f948dd88649f6f1e04bdf17c038d463057d1b5f6f2336e31853c81221f474a0
|