The Fail-Closed Execution Layer for Autonomous AI
AI Agents are moving from "chatbots" to "autonomous workflows" in Finance, Legal, and Healthcare. But there's a critical blocker: Liability.
- A 99.9% success rate means 1 in 1,000 transactions is a lawsuit
- Enterprises cannot deploy agents that rely solely on probabilistic safety filters (RLHF)
- The EU AI Act (Regulation 2024/1689) mandates human oversight for high-risk AI systems
Current solutions are soft. HSP is hard.
HSP is not a filter. It is an Interceptor.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ AI Agent │────▶│ HSP Layer │────▶│ Human │────▶│ Execution │
│ (Request) │ │ (Intercept) │ │ (Approval) │ │ (Action) │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐
│ Blocked │
│ (No Bypass) │
└─────────────┘
Key Properties:
- Fail-Closed: Actions are blocked by default until explicitly approved
- Non-Bypassable: The AI cannot circumvent the supervision layer
- Cryptographic Proof: Every approval is signed and immutable on-chain
# JavaScript/TypeScript
npm install @hsp-protocol/sdk
# Python
pip install hsp-protocolimport { HSPClient } from '@hsp-protocol/sdk';
const hsp = new HSPClient({
contractAddress: '0x1BCe4baE2E9e192EE906742a939FaFaec50A1B4e',
network: 'polygon'
});
// Request supervised action
const action = await hsp.requestAction({
type: 'FINANCIAL_TRANSFER',
amount: 50000,
recipient: '0x...',
justification: 'Quarterly vendor payment'
});
// Action is pending until human approves
console.log(action.status); // 'PENDING_SUPERVISION'
// After human approval (signed cryptographically)
console.log(action.status); // 'APPROVED'
console.log(action.proofHash); // '0x7f3a...'HSP uses a rigorous mathematical model to calculate supervision requirements:
ρ = α·A·I·(1-R) + β·(1-C)·D + (1-α-β)·T·F
Where:
A= Autonomy Level [0,1]I= Impact Severity [0,1]R= Reversibility [0,1]C= Model Confidence [0,1]D= Data Sensitivity [0,1]T= Time Criticality [0,1]F= Frequency (normalized)α = 0.618(Golden Ratio inverse)β = 0.382(φ⁻²)
σ = 1 / (1 + e^(-γ·(ρ - 0.5)))
Where γ = 4.669 (Feigenbaum constant)
HSP maps directly to EU AI Act requirements:
| EU AI Act Article | HSP Implementation |
|---|---|
| Article 14 (Human Oversight) | Fail-closed approval mechanism |
| Article 12 (Record-Keeping) | Immutable blockchain audit trail |
| Article 9 (Risk Management) | Mathematical risk scoring |
| Annex IV (Documentation) | Automated compliance reports |
┌────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER │
│ (Your AI Agent / LLM / Autonomous System) │
└─────────────────────────────┬──────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────┐
│ HSP SDK LAYER │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Observer │ │ Validator │ │ Supervisor │ │
│ │ Layer │ │ Layer │ │ Layer │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────┬──────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────┐
│ BLOCKCHAIN LAYER (Polygon) │
│ Contract: 0x1BCe4baE2E9e192EE906742a939FaFaec │
└────────────────────────────────────────────────────────────┘
| Network | Address | Status |
|---|---|---|
| Polygon Mainnet | 0x1BCe4baE2E9e192EE906742a939FaFaec50A1B4e |
Live |
| Polygon Amoy (Testnet) | Coming Soon | - |
| Ethereum Mainnet | Coming Soon | - |
Autonomous trading agents with mandatory human approval for transactions above threshold.
Diagnostic AI systems with physician sign-off requirements.
Contract analysis AI with lawyer supervision for binding decisions.
RPA bots with escalation paths for edge cases.
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the Apache License 2.0 - see LICENSE.
Important: The HSP Protocol is covered by international patent application PCT/US26/11908. Commercial use requires a license. See PATENTS.md for details.
- Website: hsp-protocol.org
- Email: contact@hsp-protocol.org
- Twitter/X: @HSPProtocol
Building the trust layer for autonomous AI.