Metadata-Version: 2.4
Name: safer-backend
Version: 0.1.7
Summary: SAFER backend — Agent Control Plane: FastAPI + SQLite WAL + Multi-Persona Judge + Gateway + Inspector + Red-Team + Compliance Pack.
Project-URL: Homepage, https://github.com/hashtagemy/safer
Project-URL: Documentation, https://github.com/hashtagemy/safer#readme
Project-URL: Repository, https://github.com/hashtagemy/safer
Project-URL: Issues, https://github.com/hashtagemy/safer/issues
Project-URL: Changelog, https://github.com/hashtagemy/safer/releases
Author: SAFER Contributors
Author-email: Mert Ozbas <mertozbas@gmail.com>
Maintainer-email: Mert Ozbas <mertozbas@gmail.com>
License-Expression: Apache-2.0
Keywords: agents,ai,claude,compliance,control-plane,gateway,inspector,judge,llm,observability,owasp-llm,policy,red-team,security,self-hosted
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.11
Requires-Dist: aiosqlite>=0.20
Requires-Dist: anthropic>=0.40
Requires-Dist: fastapi>=0.110
Requires-Dist: httpx>=0.27
Requires-Dist: jinja2>=3.1
Requires-Dist: opentelemetry-proto>=1.28
Requires-Dist: opentelemetry-sdk>=1.28
Requires-Dist: opentelemetry-semantic-conventions>=0.49b0
Requires-Dist: pydantic>=2.5
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: safer-sdk<0.2,>=0.1.7
Requires-Dist: uvicorn[standard]>=0.30
Requires-Dist: weasyprint>=62
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# safer-backend

The Agent Control Plane backend for [SAFER](https://github.com/hashtagemy/safer)
— FastAPI + SQLite WAL + Multi-Persona Judge (Opus 4.7) + Gateway +
Inspector + Red-Team Squad (Claude Managed Agents) + Compliance Pack.

```bash
pip install safer-backend
export ANTHROPIC_API_KEY=sk-ant-...
uvicorn safer_backend.main:app --host 0.0.0.0 --port 8000
```

A SAFER-instrumented agent (`pip install safer-sdk`) running anywhere
on your network can ship its 9-hook lifecycle events to this backend,
which then runs:

- **Inspector** — onboarding-phase code review (3-persona Opus call,
  optionally as a Claude Managed Agent with a shared memory store).
- **Multi-Persona Judge** — runtime evaluation with dynamic per-event
  routing across 6 personas (Security Auditor, Compliance Officer,
  Trust Guardian, Scope Enforcer, Ethics Reviewer, Policy Warden).
- **Gateway** — deterministic pre-call PII regex + 4 built-in
  policies + 3 guard modes (monitor / intervene / enforce).
- **Red-Team Squad** — manual 3-stage adversarial test (Strategist
  → Attacker → Analyst, real Claude Managed Agents path with a
  sub-agent fallback).
- **Session Report** — per-session 7-category health card,
  deterministic Python aggregator, zero Claude calls at aggregation
  time.
- **Compliance Pack** — GDPR / SOC 2 / OWASP LLM Top 10 reports
  exported as HTML / PDF (WeasyPrint) / JSON.

For the full architecture, framework matrix, dashboard walkthrough,
and demo, see the [main README](https://github.com/hashtagemy/safer#readme).

## Companion package

`safer-backend` ships alongside [`safer-sdk`](https://pypi.org/project/safer-sdk/),
the lightweight client library you install in your agent project to
emit hook events to this backend. Versions stay in lockstep —
`safer-backend>=0.1.0` requires `safer-sdk>=0.1.0,<0.2`.

## License

Apache 2.0.
