Metadata-Version: 2.4
Name: fusion-safety
Version: 0.1.2
Summary: Measure and guard AI agents: safety and quality evaluation with a runtime guardrail
Author: Fusion First
License: MIT
Project-URL: Homepage, https://fusion-first-testing.com
Project-URL: Documentation, https://fusion-first-testing.com/use
Project-URL: Trust Report, https://fusion-first-testing.com/trust
Project-URL: Source, https://github.com/Katawwr/Fusion-First
Project-URL: Issues, https://github.com/Katawwr/Fusion-First/issues
Keywords: llm,ai-safety,agentic,owasp,prompt-injection,guardrail,red-team,mcp
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
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 :: Quality Assurance
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.9
Requires-Dist: numpy>=1.26
Requires-Dist: pyyaml>=6.0
Provides-Extra: api
Requires-Dist: anthropic>=0.40; extra == "api"
Requires-Dist: openai>=1.50; extra == "api"
Provides-Extra: serve
Requires-Dist: fastapi>=0.115; extra == "serve"
Requires-Dist: uvicorn>=0.30; extra == "serve"
Requires-Dist: pydantic-settings>=2.4; extra == "serve"
Requires-Dist: httpx>=0.27; extra == "serve"
Provides-Extra: mcp
Requires-Dist: mcp<3,>=1.2; extra == "mcp"
Provides-Extra: detector
Requires-Dist: sentence-transformers>=3; extra == "detector"
Requires-Dist: scikit-learn>=1.5; extra == "detector"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: scipy>=1.13; extra == "dev"
Requires-Dist: scikit-learn>=1.5; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
Requires-Dist: ruff~=0.16.10; extra == "dev"
Requires-Dist: setuptools>=68; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Dynamic: license-file

# fusion-safety

**Measure and guard AI agents.** Fusion attacks an agent's system prompt with OWASP-mapped attacks, grades the
transcripts with a cross-family judge whose accuracy is checked on known answers in every run (the grade is
withheld when it falls short), and ships a deterministic runtime guard that redacts secrets, blocks
system-prompt dumps, and blocks tool calls (other than reads) the user's request does not cover. Results and
their pre-registrations:
[Trust Report](https://fusion-first-testing.com/trust).

## Install

```bash
pip install fusion-safety            # CLI, runs, runtime guardrail
pip install "fusion-safety[serve]"   # + local web app: fusion serve
pip install "fusion-safety[mcp]"     # + MCP server: fusion-mcp
```

## Use

```bash
fusion doctor                                        # what can run here, no model calls
fusion run start --prompt agent.txt --target ollama:llama3.2:1b --grader claude-cli
fusion run finalize --min-grade B
fusion serve                                         # the web app on 127.0.0.1:8765
```

Targets: `ollama:<model>`, `openai-compat:<url>#<model>`, `claude-cli:<model>`, hosted APIs with your own key
(`openai:`, `anthropic:`, `hf:`, ...; needs `FUSION_ALLOW_API_SPEND=1`), or any program via `cmd:<command>`.

## Runtime guardrail

```python
from fusion_first.guardrail.guard import Guardrail
from fusion_first.guardrail.policy import GuardConfig

guard = Guardrail(GuardConfig(allowlisted_domains=["your-co.com"], require_authorization=True))
outcome = guard.guard_tool_call(tool_name, tool_args, user_request=user_message,
                                untrusted_context=True, untrusted_text=tool_results)
if outcome.blocked:
    ...  # don't run it
```

Claude Code plugin: `claude plugin marketplace add "$(fusion plugin-dir)"`, then
`claude plugin install fusion@fusion-first`.

Docs and setup options: [fusion-first-testing.com/use](https://fusion-first-testing.com/use).
