ASHA Documentation¶
v0.4.2 - mission-aware agent governance (ANCHOR) plus drop-in security and optimization for LLM applications.
ASHA masks PII, reduces tokens, and checks for injection patterns before prompts reach a model. ANCHOR wraps autonomous agents with mission contracts, action guards, and OS sandboxing. The root API is process, sanitize, optimize, Agent, and anchor; everything else lives in subpackages.
Developer preview - pin
asha==0.4.2in production. APIs may change before 1.0.0.
Start here¶
| Guide | Description |
|---|---|
| Getting Started | Install and first example |
| Quickstart | 5-minute walkthrough |
| ANCHOR Runtime | Mission governance for agents |
| API Reference | process, sanitize, optimize, Agent, anchor |
| Core Concepts | Modes, results, policy |
| Examples | Common patterns |
How it works¶
Input prompt
→ Security (PII + threats)
→ Compile (internal IR → structured prompt)
→ Optimize (token compression)
→ ProcessResult
For LLM apps, add wrap_llm(client) or use Agent to preprocess before generation.
For autonomous agents, use anchor(agent) for mission-aware governance.
Public imports¶
# Root
from asha import process, sanitize, optimize, Agent, anchor
# Common advanced imports
from asha.integrations import wrap_llm
from asha.runtime.anchor import anchor_any
from asha.types import ProcessResult
from asha.core.policy_config import PolicyConfig
from asha.runtime import PromptProcessor
wrap_llm, Pipeline, Processor, and lazy root exports were removed in v0.4.1. See deprecations.md.
Documentation map¶
Essentials¶
- ANCHOR - agent governance, sandbox, adapters
- Security - PII masking, injection checks, modes
- Optimization - token reduction
- Integrations - FastAPI, LangChain, Instructor, etc.
- Debugging -
trace=True, diffs
Architecture¶
- Architecture - package layout and layer rules
- Pipeline - processing flow (3 engines, not 7 stages)
- Prompt IR - internal representation (not public API)
- Routing -
Agent(routing_config=...)
Operations¶
- Benchmarks - performance numbers
- Performance Tuning - speed vs security
- Troubleshooting - common issues
- FAQ
Project¶
- Developer Preview - scope and limitations
- Versioning - release policy
- Migration v0.4 - upgrade from 0.3.x
- Deprecations - removed APIs
- Roadmap
- Contributing
Install¶
pip install asha # Python 3.10+
pip install -e ".[docs]" && mkdocs serve # local docs