Metadata-Version: 2.4
Name: sweetai-agent-firewall
Version: 0.1.2
Summary: Pre-transaction trust firewall for AI agents: should-i-pay decisions, sybil forensics, liveness SLA (SweetAI x402 / ERC-8004)
Author-email: SweetAI <tiamatboss@gmail.com>
License: MIT
Project-URL: Homepage, https://sweetai.tiamatcrypto.com
Project-URL: Documentation, https://sweetai.tiamatcrypto.com/llms.txt
Project-URL: MCP, https://sweetai.tiamatcrypto.com/mcp
Project-URL: Source, https://sweetai.tiamatcrypto.com/agent.json
Keywords: x402,erc-8004,ai-agents,agent-payments,sybil,trust,mcp,crypto,usdc,base,solana,a2a
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.24
Dynamic: license-file

# sweetai-agent-firewall

**Pre-transaction trust firewall for AI agents.** Ask *"should I pay agent X $N?"* before any agent-to-agent payment — one call, $0.01, no API key, no subscription (x402 / USDC).

```python
from sweetai_firewall import SweetAIFirewall

fw = SweetAIFirewall()
result = fw.should_i_pay(agent_id=55985, amount_usd=25)
print(result.verdict)
# pay 0.01 USDC on eip155:8453, ... to 0x... to unlock the 25.0 USD decision
```

After your agent settles the 0.01 USDC payment (x402 `X-PAYMENT` header), the
same call returns the full decision:

```python
result.action          # "PAY" / "CAUTION" / "SKIP"
result.confidence      # 0.0 - 1.0
result.expected_loss_usd  # expected loss sized to YOUR amount
```

## What's under the hood

- **ERC-8004 / Solana-8004 on-chain feedback** analytics (Base, Ethereum, X Layer, Solana, Bittensor)
- **Sybil forensics**: reviewer concentration (Herfindahl), ghost-reviewer ratio, burst detection
- **Liveness SLA**: p50/p95 latency + flap counts, probed every 15 min
- **x402 pay-per-call**: 0.01 USDC per decision on Base/Polygon/Arbitrum/Avalanche/Sei/X Layer/Solana

## Free surfaces (no payment needed)

```python
fw.status()               # live index stats
fw.network_sybil_overview()  # risk tiers across all indexed agents
fw.pricing()              # current prices
```

## MCP alternative

All tools are also available as an MCP server for Claude Desktop / Cursor / any MCP agent:

```json
{"mcpServers": {"sweetai-agent-intel": {"url": "https://sweetai.tiamatcrypto.com/mcp", "transport": "http"}}}
```

Docs: <https://sweetai.tiamatcrypto.com/llms.txt> · Manifest: `/.well-known/x402` · agent.json: `/agent.json`
