Skip to main content

The Active Reliability Layer for AI Agents

Project description

Steer Logo

Steer

steer-labs.com

The Active Reliability Layer for AI Agents.

Stop debugging. Start teaching.
Steer turns runtime hallucinations into permanent fixes instantly.

PyPI License Twitter


Steer Mission Control

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:

  1. Dig through logs to find the specific prompt.
  2. Edit your prompt template manually.
  3. 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.

Operational Resilience

Steer is architected for mission-critical production environments:

  • Low-Latency Sidecar: Steer adds <5ms latency per verification. It runs in-process with your agent, requiring no external network hops.
  • Fail-Safe Architecture: Steer is designed to fail-safe. If the library encounters an internal error, it defaults to your configured policy to ensure system uptime.
  • Stateless by Design: Steer uses local memory and file-based logging, making it compatible with serverless (Lambda) and containerized (K8s) environments.

Privacy & Security

  • Zero Data Exfiltration: Steer is Local-First. Traces, prompts, and tool-outputs never leave your infrastructure. Verification happens entirely on your compute.
  • Audit-Ready Logging: Every blocked response is logged with a deterministic reason code for compliance and security audits.
  • Deterministic Integrity: Steer uses hard-coded assertions (Regex, AST, Pydantic), eliminating the risk of "Verifier Hallucination" common in LLM-as-a-judge setups.

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, 03_logic_guard.py, 04_slop_guard.py

steer ui
# Starts the local dashboard at http://localhost:8000

Run a demo (from the same folder):

  1. Fail: Run python 01_structure_guard.py. Output will show [-] Status: Blocked.
  2. Teach: Go to http://localhost:8000. Click the incident, select Teach, and save the rule.
  3. Fix: Run python 01_structure_guard.py again. Output will 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. Structure Guard Demo

2. Safety Guard (PII)

Problem: Agent accidentally leaks customer emails or internal keys. Fix: Block the response and enforce redaction protocols. Safety Guard Demo

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. Logic Guard Demo

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. Slop Filter Demo

Cookbook

Explore the cookbook/ directory for enterprise-grade implementations.

RAG Reliability

Enforce strict data schemas and grounding citations in a RAG pipeline.

SQL Security

Enforce read-only protocols and prevent destructive SQL injections in analytics agents.

Integration

Add steer_rules to your function arguments. Steer populates this automatically via dependency injection.

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.

Production-Ready Checklist

  • Pydantic v2 Compatible: Built on high-performance serialization.
  • Thread-Safe: Tested for high-concurrency environments.
  • Zero Dependencies: Minimal footprint to reduce supply-chain risk.
  • Local-First: No external API dependencies for core verification.

Star History

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steer_sdk-0.3.3.tar.gz (461.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steer_sdk-0.3.3-py3-none-any.whl (477.8 kB view details)

Uploaded Python 3

File details

Details for the file steer_sdk-0.3.3.tar.gz.

File metadata

  • Download URL: steer_sdk-0.3.3.tar.gz
  • Upload date:
  • Size: 461.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Darwin/24.6.0

File hashes

Hashes for steer_sdk-0.3.3.tar.gz
Algorithm Hash digest
SHA256 c7607dd27d02892e83cc07a07693020823024563a81bbc24c3e2cfc997b7dd59
MD5 03db09306b8367755b7cba465cce969f
BLAKE2b-256 6164bc869d8bea779544b5e75c1b9307fa42ca6b76dfa87ff71acc37794df955

See more details on using hashes here.

File details

Details for the file steer_sdk-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: steer_sdk-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 477.8 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

Hashes for steer_sdk-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 319146c5dd252d91260f59a7fdc7f995d99da6612ebaf6029f82981deb577f0b
MD5 a77486b7b30d1d400d87b823020a082b
BLAKE2b-256 a9267ff19cd306cb0581ba3b07161488265517b83b8b03218d063a66f53d411e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page