Open Source — MIT Licensed

Protect Every AI Request

A local proxy gateway that enforces policies, detects prompt injection, redacts PII, and logs every request — zero code changes required.

$ npm install -g @openbastion-ai/cli
Your App Rate Limit Injection Policy Cache LLM Provider

The Bastion Pipeline — every request, every time

The Problem

AI agents make thousands of API calls with no oversight. Sensitive data leaks into prompts. Prompt injection goes undetected. There's no audit trail, no rate limiting, no policy enforcement.

The Solution

Point your ANTHROPIC_BASE_URL at Bastion and it intercepts transparently. Declarative policies in bastion.yaml — version-controlled, PR-reviewed. Every request logged.

Built for Production

Everything you need to secure AI agent traffic, out of the box.

Policy Engine

Declarative rules in bastion.yaml. Block, warn, redact, or tag based on content patterns, injection scores, and PII detection.

Provider Fallback

Automatic failover from primary to fallback provider on 429 or 5xx errors. Zero downtime, zero code changes.

Injection Detection

Heuristic pattern matching scores every user message for prompt injection attempts. Block above your configured threshold.

PII Redaction

Detect and redact emails, phone numbers, SSNs, and credit cards before they reach the model. Enterprise tier adds ML detection.

Response Cache

Exact-match response caching with configurable TTL. Skip redundant API calls and reduce costs.

Audit Trail

Structured JSONL logging of every request — tokens, cost, latency, policy decisions. File, stdout, or HTTP output.

Get Started in 60 Seconds

Four steps. No SDK. No code changes.

1

Install

$ npm install -g @openbastion-ai/cli
2

Configure

# bastion.yaml version: "1" proxy: port: 4000 providers: primary: anthropic definitions: anthropic: api_key: "${ANTHROPIC_API_KEY}" audit: enabled: true output: stdout
3

Start

$ bastion start
4

Point your app

$ ANTHROPIC_BASE_URL=http://localhost:4000 node your-app.js

Part of the Trilogy

Three tools. One mission. Ship AI agents you can trust.