Skip to main content

Error observability for the agent era

Project description

bastion

Error observability for the agent era.

What is Bastion?

Traditional error handling is designed for humans: stack traces printed to a terminal, logs scrolled through in a browser, exceptions caught and swallowed silently. Bastion is built on a different assumption — that the primary debugger is a coding agent, not a human. Every error record, checkpoint, and failed assertion is structured for easy ingestion by an agent's context window, not a human's eyes.

Bastion sits at the boundary between your code and the agent working on it. It captures the information an agent needs to diagnose a failure — exception type, location, local variables — and makes it retrievable without manual log trawling. The goal is to shrink the feedback loop between a bug occurring and an agent understanding it.

Installation

pip install bastion

Quick start

import bastion

# Initialize at the entry point of your application or agent session.
bastion.init()

# Wrap any function — errors are captured and structured automatically.
@bastion.guard(context=["user_id", "payload"])
def process(user_id: str, payload: dict) -> dict:
    if not payload:
        raise ValueError("empty payload")
    return {"ok": True}

# Mark progress through a multi-step flow.
bastion.checkpoint("ingest", "parse-complete", data={"rows": 42})

# Assert invariants in a way an agent can query later.
bastion.expect(len(results) > 0, "search must return results", context={"query": query})

Coming soon

  • SQLite persistence — every error, checkpoint, and expectation stored locally and queryable
  • MCP server — expose Bastion data to any MCP-compatible agent via structured tools
  • Local variable capturecontext= on guard() will snapshot named variables at the point of failure
  • Error fingerprinting — stable IDs for recurring errors so agents can track frequency over time

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

bastion_agent-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

bastion_agent-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file bastion_agent-0.1.0.tar.gz.

File metadata

  • Download URL: bastion_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for bastion_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59a4a1f26cd285de3327d9f2289b39d73d7ed9c889f3823618ef09e0cf981a1d
MD5 6ed512e64ac39d80086a5a424bfab35a
BLAKE2b-256 cd251c9148a5849d41311d8efee3ed32f67e242883184d86bb5df17619f991ab

See more details on using hashes here.

File details

Details for the file bastion_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bastion_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for bastion_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61b5ca62b3cab45a127809d0f1c389604681b12275ca747af664c2b59e77c879
MD5 f9c2759336d36cb73de88759315b9c87
BLAKE2b-256 60af2f655d7fb41548c2dd5df7fc8dcbcf1a6e1f79cbe43e21dc53f33345f8fc

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