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.

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):

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

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

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.

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.2.tar.gz (459.8 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.2-py3-none-any.whl (476.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: steer_sdk-0.3.2.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

Hashes for steer_sdk-0.3.2.tar.gz
Algorithm Hash digest
SHA256 c5a384e66737efc64a525690a1d01da027b1c5d60a69285079cf39f58474ace7
MD5 762018af19fbb49775b356f78b1f7bae
BLAKE2b-256 ae635dcc1c7746ab7c614f2ac77f34f48af98d0febcc07820c7a3818fe523cd1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: steer_sdk-0.3.2-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

Hashes for steer_sdk-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da4b738144b6ba30c251955e1f21ad2b540891f0cc8c04f620d8d699d905a3f7
MD5 b64c74847da26744f2dcb626fb0b0e6e
BLAKE2b-256 aad55d99b136e56e1cc22863fc7718d8f25ada560f5a2c2893a93333560958de

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