aip-protocol 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aip_protocol-0.1.0/.dockerignore +23 -0
- aip_protocol-0.1.0/.gitignore +43 -0
- aip_protocol-0.1.0/LICENSE +21 -0
- aip_protocol-0.1.0/PKG-INFO +283 -0
- aip_protocol-0.1.0/README.md +259 -0
- aip_protocol-0.1.0/RFC-001.md +225 -0
- aip_protocol-0.1.0/aip_protocol/__init__.py +49 -0
- aip_protocol-0.1.0/aip_protocol/cli.py +207 -0
- aip_protocol-0.1.0/aip_protocol/crypto.py +132 -0
- aip_protocol-0.1.0/aip_protocol/envelope.py +165 -0
- aip_protocol-0.1.0/aip_protocol/errors.py +93 -0
- aip_protocol-0.1.0/aip_protocol/models.py +205 -0
- aip_protocol-0.1.0/aip_protocol/passport.py +233 -0
- aip_protocol-0.1.0/aip_protocol/revocation.py +209 -0
- aip_protocol-0.1.0/aip_protocol/trust.py +133 -0
- aip_protocol-0.1.0/aip_protocol/verification.py +504 -0
- aip_protocol-0.1.0/pyproject.toml +41 -0
- aip_protocol-0.1.0/tests/test_aip.py +996 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
*.pyo
|
|
4
|
+
*.pyd
|
|
5
|
+
.Python
|
|
6
|
+
env/
|
|
7
|
+
venv/
|
|
8
|
+
.env
|
|
9
|
+
.venv
|
|
10
|
+
pip-log.txt
|
|
11
|
+
pip-delete-this-directory.txt
|
|
12
|
+
.tox/
|
|
13
|
+
.coverage
|
|
14
|
+
.coverage.*
|
|
15
|
+
.cache
|
|
16
|
+
nosetests.xml
|
|
17
|
+
coverage.xml
|
|
18
|
+
*.cover
|
|
19
|
+
*.log
|
|
20
|
+
.git
|
|
21
|
+
.mypy_cache
|
|
22
|
+
.pytest_cache
|
|
23
|
+
.hypotheses
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ── Commercial Product (PRIVATE — never push) ──
|
|
2
|
+
kya_api/
|
|
3
|
+
dashboard/
|
|
4
|
+
*.pem
|
|
5
|
+
Dockerfile
|
|
6
|
+
docker-compose.yml
|
|
7
|
+
Caddyfile
|
|
8
|
+
start.sh
|
|
9
|
+
setup.sh
|
|
10
|
+
data/
|
|
11
|
+
|
|
12
|
+
# ── Logs & Runtime ──
|
|
13
|
+
*.log
|
|
14
|
+
startup.log
|
|
15
|
+
backend.log
|
|
16
|
+
frontend.log
|
|
17
|
+
nohup.out
|
|
18
|
+
|
|
19
|
+
# ── Python ──
|
|
20
|
+
__pycache__/
|
|
21
|
+
*.pyc
|
|
22
|
+
*.pyo
|
|
23
|
+
*.egg-info/
|
|
24
|
+
dist/
|
|
25
|
+
build/
|
|
26
|
+
*.whl
|
|
27
|
+
.eggs/
|
|
28
|
+
|
|
29
|
+
# ── Environment ──
|
|
30
|
+
.env
|
|
31
|
+
.venv/
|
|
32
|
+
venv/
|
|
33
|
+
env/
|
|
34
|
+
|
|
35
|
+
# ── IDE ──
|
|
36
|
+
.vscode/
|
|
37
|
+
.idea/
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
40
|
+
|
|
41
|
+
# ── OS ──
|
|
42
|
+
.DS_Store
|
|
43
|
+
Thumbs.db
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KYA Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aip-protocol
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Agent Intent Protocol — Proof of Intent for the Agentic Web
|
|
5
|
+
Author-email: Aniket Giri <aniket@kyalabs.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agents,ai,identity,protocol,trust,verification
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Security :: Cryptography
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Requires-Dist: click>=8.0
|
|
17
|
+
Requires-Dist: cryptography>=42.0
|
|
18
|
+
Requires-Dist: pydantic>=2.0
|
|
19
|
+
Requires-Dist: rich>=13.0
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
<img src="https://img.shields.io/badge/Protocol-AIP--1-0B0D10?style=for-the-badge&labelColor=0B0D10&color=ABDBE3" alt="AIP-1" />
|
|
27
|
+
<img src="https://img.shields.io/badge/Crypto-Ed25519-0B0D10?style=for-the-badge&labelColor=0B0D10&color=34D399" alt="Ed25519" />
|
|
28
|
+
<img src="https://img.shields.io/pypi/v/aip-protocol?style=for-the-badge&labelColor=0B0D10&color=A78BFA&label=PyPI" alt="PyPI" />
|
|
29
|
+
<img src="https://img.shields.io/badge/Tests-63%20passing-0B0D10?style=for-the-badge&labelColor=0B0D10&color=34D399" alt="Tests" />
|
|
30
|
+
<img src="https://img.shields.io/badge/License-MIT-0B0D10?style=for-the-badge&labelColor=0B0D10&color=94A3B8" alt="License" />
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<h1 align="center">AIP — Agent Intent Protocol</h1>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<strong>The HTTPS for AI Agents.</strong><br/>
|
|
37
|
+
Cryptographic identity, intent verification, and boundary enforcement for autonomous agents.
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<p align="center">
|
|
41
|
+
<a href="https://aip.synthexai.tech/docs">Documentation</a> ·
|
|
42
|
+
<a href="https://aip.synthexai.tech">Live Dashboard</a> ·
|
|
43
|
+
<a href="https://pypi.org/project/aip-protocol/">PyPI</a>
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## The Problem
|
|
49
|
+
|
|
50
|
+
Every AI framework lets agents **do things**. None of them verify **what agents are allowed to do**.
|
|
51
|
+
|
|
52
|
+
A LangChain agent can drain a bank account. An AutoGPT agent can email your customers. A CrewAI agent can delete production data. There is no standard way to verify an agent's identity, enforce its boundaries, or revoke it in real-time.
|
|
53
|
+
|
|
54
|
+
**AIP fixes this.**
|
|
55
|
+
|
|
56
|
+
## What is AIP?
|
|
57
|
+
|
|
58
|
+
AIP-1 is a trustless, cross-platform protocol for verifying the **identity**, **intent**, and **authorization boundaries** of autonomous AI agents before they act.
|
|
59
|
+
|
|
60
|
+
Think of it as **OAuth + TLS, purpose-built for the agentic web**.
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Agent wants to act → Creates signed Intent Envelope → Verifier checks 8-step pipeline → Allow or Deny
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Core Capabilities
|
|
67
|
+
|
|
68
|
+
| Capability | What it does |
|
|
69
|
+
|---|---|
|
|
70
|
+
| **Cryptographic Identity** | Ed25519 keypair per agent, DID-based addressing (`did:web:`) |
|
|
71
|
+
| **Boundary Enforcement** | Action allowlists, deny lists, monetary limits, geo restrictions |
|
|
72
|
+
| **Tiered Verification** | Sub-millisecond for low-risk, full crypto for high-value intents |
|
|
73
|
+
| **Kill Switch** | Revoke or suspend any agent globally with zero propagation delay |
|
|
74
|
+
| **Trust Scores** | Bayesian reputation model — trust is earned over successful verifications |
|
|
75
|
+
| **Intent Drift Detection** | Semantic classifier flags actions outside an agent's declared scope |
|
|
76
|
+
| **Structured Error Codes** | 22 machine-readable `AIP-Exxx` codes across 5 categories for audit trails |
|
|
77
|
+
|
|
78
|
+
## Install
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install aip-protocol
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Quick Start
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from aip_protocol import AgentPassport, create_envelope, sign_envelope, verify_intent
|
|
88
|
+
from aip_protocol.revocation import RevocationStore
|
|
89
|
+
|
|
90
|
+
# 1 — Create an agent passport (identity + keys + boundaries)
|
|
91
|
+
passport = AgentPassport.create(
|
|
92
|
+
domain="yourco.com",
|
|
93
|
+
agent_name="procurement-bot",
|
|
94
|
+
allowed_actions=["read_invoice", "transfer_funds"],
|
|
95
|
+
monetary_limit_per_txn=50.0,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
print(passport.agent_id)
|
|
99
|
+
# → "did:web:yourco.com:agents:procurement-bot"
|
|
100
|
+
|
|
101
|
+
# 2 — Agent wants to act: create and sign an intent envelope
|
|
102
|
+
envelope = create_envelope(
|
|
103
|
+
passport,
|
|
104
|
+
action="transfer_funds",
|
|
105
|
+
target="did:web:vendor.com",
|
|
106
|
+
parameters={"amount": 45.00, "currency": "USD"},
|
|
107
|
+
)
|
|
108
|
+
signed = sign_envelope(envelope, passport.private_key)
|
|
109
|
+
|
|
110
|
+
# 3 — Verifier checks the intent through the 8-step pipeline
|
|
111
|
+
store = RevocationStore()
|
|
112
|
+
result = verify_intent(signed, passport.public_key, revocation_store=store)
|
|
113
|
+
|
|
114
|
+
if result.passed:
|
|
115
|
+
print(f"✓ Verified — tier: {result.tier_used.value}, trust: {result.trust_score}")
|
|
116
|
+
else:
|
|
117
|
+
for error in result.errors:
|
|
118
|
+
print(f"✗ {error.value}: {error.name}")
|
|
119
|
+
# e.g. "✗ AIP-E202: MONETARY_LIMIT"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Verification Pipeline
|
|
123
|
+
|
|
124
|
+
Every intent passes through an 8-step verification pipeline. The protocol auto-selects the verification tier based on risk:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
┌────────────────────────────────────────────────────────┐
|
|
128
|
+
│ Intent Envelope │
|
|
129
|
+
│ ┌───────────┐ ┌───────────┐ ┌────────────────────┐ │
|
|
130
|
+
│ │ Agent ID │ │ Intent │ │ Boundaries │ │
|
|
131
|
+
│ │ (DID) │ │ (Action) │ │ (The Cage) │ │
|
|
132
|
+
│ └─────┬──────┘ └─────┬─────┘ └──────────┬─────────┘ │
|
|
133
|
+
│ └───────────────┼────────────────────┘ │
|
|
134
|
+
│ ┌─────▼─────┐ │
|
|
135
|
+
│ │ Proof │ ← Ed25519 signature │
|
|
136
|
+
│ └───────────┘ │
|
|
137
|
+
└────────────────────────────────────────────────────────┘
|
|
138
|
+
│
|
|
139
|
+
▼
|
|
140
|
+
┌────────────────────────────────────────────────────────┐
|
|
141
|
+
│ Verification Pipeline │
|
|
142
|
+
│ │
|
|
143
|
+
│ ① Version Check ⑤ Attestation Verify │
|
|
144
|
+
│ ② Schema Validation ⑥ Revocation Check │
|
|
145
|
+
│ ③ Expiry Check ⑦ Trust Score Evaluation │
|
|
146
|
+
│ ④ Boundary Check ⑧ Final Verdict │
|
|
147
|
+
│ └─ Actions │
|
|
148
|
+
│ └─ Monetary limits │
|
|
149
|
+
│ └─ Geo restrictions │
|
|
150
|
+
│ └─ Intent drift │
|
|
151
|
+
└────────────────────────────────────────────────────────┘
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Tiered Verification
|
|
155
|
+
|
|
156
|
+
Not every intent needs full cryptographic verification. AIP auto-selects the tier:
|
|
157
|
+
|
|
158
|
+
| Tier | Use Case | Latency | What Runs |
|
|
159
|
+
|---|---|---|---|
|
|
160
|
+
| **Tier 0** | Low-risk, cached, in-session repeats | **<1ms** | HMAC + boundary proof |
|
|
161
|
+
| **Tier 1** | Normal operations | **~5ms** | Ed25519 + boundary + revocation |
|
|
162
|
+
| **Tier 2** | High-value, cross-org, first contact | **~50–100ms** | Full 8-step pipeline |
|
|
163
|
+
|
|
164
|
+
## Error Taxonomy
|
|
165
|
+
|
|
166
|
+
Every failure returns a machine-readable `AIP-Exxx` code — not a generic 400. Your logs, dashboards, and audit trails show *exactly* what went wrong.
|
|
167
|
+
|
|
168
|
+
| Range | Category | Examples |
|
|
169
|
+
|---|---|---|
|
|
170
|
+
| `AIP-E1xx` | **Envelope Errors** | `E100` Invalid Signature · `E101` Expired · `E102` Replay Detected |
|
|
171
|
+
| `AIP-E2xx` | **Boundary Violations** | `E200` Action Not Allowed · `E202` Monetary Limit · `E204` Geo Restricted |
|
|
172
|
+
| `AIP-E3xx` | **Attestation Failures** | `E300` Model Hash Mismatch · `E303` Intent Drift |
|
|
173
|
+
| `AIP-E4xx` | **Trust Failures** | `E400` Agent Revoked · `E403` Delegation Invalid · `E404` Trust Too Low |
|
|
174
|
+
| `AIP-E5xx` | **Protocol Errors** | `E500` Mesh Unavailable · `E502` Handshake Timeout |
|
|
175
|
+
|
|
176
|
+
Full reference → [aip.synthexai.tech/docs#errors](https://aip.synthexai.tech/docs#errors)
|
|
177
|
+
|
|
178
|
+
## CLI
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Create a passport
|
|
182
|
+
aip create-passport --domain yourco.com --name my-agent \
|
|
183
|
+
-a read_data -a transfer_funds -m 100
|
|
184
|
+
|
|
185
|
+
# Sign an intent
|
|
186
|
+
aip sign-intent --passport ./agent_passport \
|
|
187
|
+
--action transfer_funds --amount 45 -o intent.json
|
|
188
|
+
|
|
189
|
+
# Verify an intent
|
|
190
|
+
aip verify --envelope intent.json \
|
|
191
|
+
--public-key ./agent_passport/public.pem
|
|
192
|
+
|
|
193
|
+
# Revoke an agent instantly
|
|
194
|
+
aip revoke "did:web:yourco.com:agents:my-agent" --reason "compromised"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Hosted API
|
|
198
|
+
|
|
199
|
+
Self-host the verification engine, or use the managed cloud at [aip.synthexai.tech](https://aip.synthexai.tech):
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
curl -X POST https://aip.synthexai.tech/api/verify \
|
|
203
|
+
-H "X-API-Key: kya_YOUR_KEY" \
|
|
204
|
+
-H "Content-Type: application/json" \
|
|
205
|
+
-d '{
|
|
206
|
+
"agent_id": "did:web:yourco.com:agents:my-bot",
|
|
207
|
+
"action": "transfer_funds",
|
|
208
|
+
"target": "did:web:vendor.com",
|
|
209
|
+
"parameters": {"amount": 45.00}
|
|
210
|
+
}'
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"verified": true,
|
|
216
|
+
"tier": "tier_1",
|
|
217
|
+
"signature_valid": true,
|
|
218
|
+
"within_boundaries": true,
|
|
219
|
+
"trust_score": 0.847,
|
|
220
|
+
"latency_ms": 3.21,
|
|
221
|
+
"errors": []
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Full API docs → [aip.synthexai.tech/docs](https://aip.synthexai.tech/docs)
|
|
226
|
+
|
|
227
|
+
## Framework Compatibility
|
|
228
|
+
|
|
229
|
+
AIP is framework-agnostic. It works with any agent runtime:
|
|
230
|
+
|
|
231
|
+
| Framework | Status | Notes |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| LangChain / LangGraph | ✅ Supported | Framework attestation via `framework_id` |
|
|
234
|
+
| AutoGPT | ✅ Supported | Boundary enforcement on plugin calls |
|
|
235
|
+
| CrewAI | ✅ Supported | Per-agent passport, shared trust mesh |
|
|
236
|
+
| Custom Python agents | ✅ Supported | Any agent can create a passport |
|
|
237
|
+
| OpenAI Assistants | 🔜 Planned | Function-call boundary mapping |
|
|
238
|
+
|
|
239
|
+
## Development
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
git clone https://github.com/theaniketgiri/aip.git
|
|
243
|
+
cd aip
|
|
244
|
+
pip install -e ".[dev]"
|
|
245
|
+
pytest tests/ -v
|
|
246
|
+
# 63 tests, all passing
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Project Structure
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
aip_protocol/
|
|
253
|
+
├── passport.py # Agent identity + Ed25519 key management
|
|
254
|
+
├── envelope.py # Intent envelope creation + signing
|
|
255
|
+
├── verification.py # 8-step verification pipeline + intent classifier
|
|
256
|
+
├── crypto.py # Ed25519 + HMAC cryptographic layer
|
|
257
|
+
├── errors.py # AIP-Exxx error taxonomy (22 structured codes)
|
|
258
|
+
├── revocation.py # Real-time revocation store with rehydration
|
|
259
|
+
├── trust.py # Bayesian trust score engine
|
|
260
|
+
├── models.py # Protocol data models (Pydantic)
|
|
261
|
+
└── cli.py # Command-line interface
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Design Partners
|
|
265
|
+
|
|
266
|
+
We're onboarding **early design partners** building multi-agent systems. Partners get:
|
|
267
|
+
|
|
268
|
+
- Enterprise-tier API access (free during beta)
|
|
269
|
+
- Direct engineering support
|
|
270
|
+
- Protocol roadmap influence
|
|
271
|
+
|
|
272
|
+
→ **[Apply at aip.synthexai.tech](https://aip.synthexai.tech)**
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
<p align="center">
|
|
281
|
+
<sub><strong>KYA Labs</strong> — Know Your Agent before it acts.</sub><br/>
|
|
282
|
+
<sub><a href="https://aip.synthexai.tech">Website</a> · <a href="https://aip.synthexai.tech/docs">API Docs</a> · <a href="https://pypi.org/project/aip-protocol/">PyPI</a></sub>
|
|
283
|
+
</p>
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/badge/Protocol-AIP--1-0B0D10?style=for-the-badge&labelColor=0B0D10&color=ABDBE3" alt="AIP-1" />
|
|
3
|
+
<img src="https://img.shields.io/badge/Crypto-Ed25519-0B0D10?style=for-the-badge&labelColor=0B0D10&color=34D399" alt="Ed25519" />
|
|
4
|
+
<img src="https://img.shields.io/pypi/v/aip-protocol?style=for-the-badge&labelColor=0B0D10&color=A78BFA&label=PyPI" alt="PyPI" />
|
|
5
|
+
<img src="https://img.shields.io/badge/Tests-63%20passing-0B0D10?style=for-the-badge&labelColor=0B0D10&color=34D399" alt="Tests" />
|
|
6
|
+
<img src="https://img.shields.io/badge/License-MIT-0B0D10?style=for-the-badge&labelColor=0B0D10&color=94A3B8" alt="License" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<h1 align="center">AIP — Agent Intent Protocol</h1>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>The HTTPS for AI Agents.</strong><br/>
|
|
13
|
+
Cryptographic identity, intent verification, and boundary enforcement for autonomous agents.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://aip.synthexai.tech/docs">Documentation</a> ·
|
|
18
|
+
<a href="https://aip.synthexai.tech">Live Dashboard</a> ·
|
|
19
|
+
<a href="https://pypi.org/project/aip-protocol/">PyPI</a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## The Problem
|
|
25
|
+
|
|
26
|
+
Every AI framework lets agents **do things**. None of them verify **what agents are allowed to do**.
|
|
27
|
+
|
|
28
|
+
A LangChain agent can drain a bank account. An AutoGPT agent can email your customers. A CrewAI agent can delete production data. There is no standard way to verify an agent's identity, enforce its boundaries, or revoke it in real-time.
|
|
29
|
+
|
|
30
|
+
**AIP fixes this.**
|
|
31
|
+
|
|
32
|
+
## What is AIP?
|
|
33
|
+
|
|
34
|
+
AIP-1 is a trustless, cross-platform protocol for verifying the **identity**, **intent**, and **authorization boundaries** of autonomous AI agents before they act.
|
|
35
|
+
|
|
36
|
+
Think of it as **OAuth + TLS, purpose-built for the agentic web**.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Agent wants to act → Creates signed Intent Envelope → Verifier checks 8-step pipeline → Allow or Deny
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Core Capabilities
|
|
43
|
+
|
|
44
|
+
| Capability | What it does |
|
|
45
|
+
|---|---|
|
|
46
|
+
| **Cryptographic Identity** | Ed25519 keypair per agent, DID-based addressing (`did:web:`) |
|
|
47
|
+
| **Boundary Enforcement** | Action allowlists, deny lists, monetary limits, geo restrictions |
|
|
48
|
+
| **Tiered Verification** | Sub-millisecond for low-risk, full crypto for high-value intents |
|
|
49
|
+
| **Kill Switch** | Revoke or suspend any agent globally with zero propagation delay |
|
|
50
|
+
| **Trust Scores** | Bayesian reputation model — trust is earned over successful verifications |
|
|
51
|
+
| **Intent Drift Detection** | Semantic classifier flags actions outside an agent's declared scope |
|
|
52
|
+
| **Structured Error Codes** | 22 machine-readable `AIP-Exxx` codes across 5 categories for audit trails |
|
|
53
|
+
|
|
54
|
+
## Install
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install aip-protocol
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from aip_protocol import AgentPassport, create_envelope, sign_envelope, verify_intent
|
|
64
|
+
from aip_protocol.revocation import RevocationStore
|
|
65
|
+
|
|
66
|
+
# 1 — Create an agent passport (identity + keys + boundaries)
|
|
67
|
+
passport = AgentPassport.create(
|
|
68
|
+
domain="yourco.com",
|
|
69
|
+
agent_name="procurement-bot",
|
|
70
|
+
allowed_actions=["read_invoice", "transfer_funds"],
|
|
71
|
+
monetary_limit_per_txn=50.0,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
print(passport.agent_id)
|
|
75
|
+
# → "did:web:yourco.com:agents:procurement-bot"
|
|
76
|
+
|
|
77
|
+
# 2 — Agent wants to act: create and sign an intent envelope
|
|
78
|
+
envelope = create_envelope(
|
|
79
|
+
passport,
|
|
80
|
+
action="transfer_funds",
|
|
81
|
+
target="did:web:vendor.com",
|
|
82
|
+
parameters={"amount": 45.00, "currency": "USD"},
|
|
83
|
+
)
|
|
84
|
+
signed = sign_envelope(envelope, passport.private_key)
|
|
85
|
+
|
|
86
|
+
# 3 — Verifier checks the intent through the 8-step pipeline
|
|
87
|
+
store = RevocationStore()
|
|
88
|
+
result = verify_intent(signed, passport.public_key, revocation_store=store)
|
|
89
|
+
|
|
90
|
+
if result.passed:
|
|
91
|
+
print(f"✓ Verified — tier: {result.tier_used.value}, trust: {result.trust_score}")
|
|
92
|
+
else:
|
|
93
|
+
for error in result.errors:
|
|
94
|
+
print(f"✗ {error.value}: {error.name}")
|
|
95
|
+
# e.g. "✗ AIP-E202: MONETARY_LIMIT"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Verification Pipeline
|
|
99
|
+
|
|
100
|
+
Every intent passes through an 8-step verification pipeline. The protocol auto-selects the verification tier based on risk:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
┌────────────────────────────────────────────────────────┐
|
|
104
|
+
│ Intent Envelope │
|
|
105
|
+
│ ┌───────────┐ ┌───────────┐ ┌────────────────────┐ │
|
|
106
|
+
│ │ Agent ID │ │ Intent │ │ Boundaries │ │
|
|
107
|
+
│ │ (DID) │ │ (Action) │ │ (The Cage) │ │
|
|
108
|
+
│ └─────┬──────┘ └─────┬─────┘ └──────────┬─────────┘ │
|
|
109
|
+
│ └───────────────┼────────────────────┘ │
|
|
110
|
+
│ ┌─────▼─────┐ │
|
|
111
|
+
│ │ Proof │ ← Ed25519 signature │
|
|
112
|
+
│ └───────────┘ │
|
|
113
|
+
└────────────────────────────────────────────────────────┘
|
|
114
|
+
│
|
|
115
|
+
▼
|
|
116
|
+
┌────────────────────────────────────────────────────────┐
|
|
117
|
+
│ Verification Pipeline │
|
|
118
|
+
│ │
|
|
119
|
+
│ ① Version Check ⑤ Attestation Verify │
|
|
120
|
+
│ ② Schema Validation ⑥ Revocation Check │
|
|
121
|
+
│ ③ Expiry Check ⑦ Trust Score Evaluation │
|
|
122
|
+
│ ④ Boundary Check ⑧ Final Verdict │
|
|
123
|
+
│ └─ Actions │
|
|
124
|
+
│ └─ Monetary limits │
|
|
125
|
+
│ └─ Geo restrictions │
|
|
126
|
+
│ └─ Intent drift │
|
|
127
|
+
└────────────────────────────────────────────────────────┘
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Tiered Verification
|
|
131
|
+
|
|
132
|
+
Not every intent needs full cryptographic verification. AIP auto-selects the tier:
|
|
133
|
+
|
|
134
|
+
| Tier | Use Case | Latency | What Runs |
|
|
135
|
+
|---|---|---|---|
|
|
136
|
+
| **Tier 0** | Low-risk, cached, in-session repeats | **<1ms** | HMAC + boundary proof |
|
|
137
|
+
| **Tier 1** | Normal operations | **~5ms** | Ed25519 + boundary + revocation |
|
|
138
|
+
| **Tier 2** | High-value, cross-org, first contact | **~50–100ms** | Full 8-step pipeline |
|
|
139
|
+
|
|
140
|
+
## Error Taxonomy
|
|
141
|
+
|
|
142
|
+
Every failure returns a machine-readable `AIP-Exxx` code — not a generic 400. Your logs, dashboards, and audit trails show *exactly* what went wrong.
|
|
143
|
+
|
|
144
|
+
| Range | Category | Examples |
|
|
145
|
+
|---|---|---|
|
|
146
|
+
| `AIP-E1xx` | **Envelope Errors** | `E100` Invalid Signature · `E101` Expired · `E102` Replay Detected |
|
|
147
|
+
| `AIP-E2xx` | **Boundary Violations** | `E200` Action Not Allowed · `E202` Monetary Limit · `E204` Geo Restricted |
|
|
148
|
+
| `AIP-E3xx` | **Attestation Failures** | `E300` Model Hash Mismatch · `E303` Intent Drift |
|
|
149
|
+
| `AIP-E4xx` | **Trust Failures** | `E400` Agent Revoked · `E403` Delegation Invalid · `E404` Trust Too Low |
|
|
150
|
+
| `AIP-E5xx` | **Protocol Errors** | `E500` Mesh Unavailable · `E502` Handshake Timeout |
|
|
151
|
+
|
|
152
|
+
Full reference → [aip.synthexai.tech/docs#errors](https://aip.synthexai.tech/docs#errors)
|
|
153
|
+
|
|
154
|
+
## CLI
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Create a passport
|
|
158
|
+
aip create-passport --domain yourco.com --name my-agent \
|
|
159
|
+
-a read_data -a transfer_funds -m 100
|
|
160
|
+
|
|
161
|
+
# Sign an intent
|
|
162
|
+
aip sign-intent --passport ./agent_passport \
|
|
163
|
+
--action transfer_funds --amount 45 -o intent.json
|
|
164
|
+
|
|
165
|
+
# Verify an intent
|
|
166
|
+
aip verify --envelope intent.json \
|
|
167
|
+
--public-key ./agent_passport/public.pem
|
|
168
|
+
|
|
169
|
+
# Revoke an agent instantly
|
|
170
|
+
aip revoke "did:web:yourco.com:agents:my-agent" --reason "compromised"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Hosted API
|
|
174
|
+
|
|
175
|
+
Self-host the verification engine, or use the managed cloud at [aip.synthexai.tech](https://aip.synthexai.tech):
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
curl -X POST https://aip.synthexai.tech/api/verify \
|
|
179
|
+
-H "X-API-Key: kya_YOUR_KEY" \
|
|
180
|
+
-H "Content-Type: application/json" \
|
|
181
|
+
-d '{
|
|
182
|
+
"agent_id": "did:web:yourco.com:agents:my-bot",
|
|
183
|
+
"action": "transfer_funds",
|
|
184
|
+
"target": "did:web:vendor.com",
|
|
185
|
+
"parameters": {"amount": 45.00}
|
|
186
|
+
}'
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"verified": true,
|
|
192
|
+
"tier": "tier_1",
|
|
193
|
+
"signature_valid": true,
|
|
194
|
+
"within_boundaries": true,
|
|
195
|
+
"trust_score": 0.847,
|
|
196
|
+
"latency_ms": 3.21,
|
|
197
|
+
"errors": []
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Full API docs → [aip.synthexai.tech/docs](https://aip.synthexai.tech/docs)
|
|
202
|
+
|
|
203
|
+
## Framework Compatibility
|
|
204
|
+
|
|
205
|
+
AIP is framework-agnostic. It works with any agent runtime:
|
|
206
|
+
|
|
207
|
+
| Framework | Status | Notes |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| LangChain / LangGraph | ✅ Supported | Framework attestation via `framework_id` |
|
|
210
|
+
| AutoGPT | ✅ Supported | Boundary enforcement on plugin calls |
|
|
211
|
+
| CrewAI | ✅ Supported | Per-agent passport, shared trust mesh |
|
|
212
|
+
| Custom Python agents | ✅ Supported | Any agent can create a passport |
|
|
213
|
+
| OpenAI Assistants | 🔜 Planned | Function-call boundary mapping |
|
|
214
|
+
|
|
215
|
+
## Development
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
git clone https://github.com/theaniketgiri/aip.git
|
|
219
|
+
cd aip
|
|
220
|
+
pip install -e ".[dev]"
|
|
221
|
+
pytest tests/ -v
|
|
222
|
+
# 63 tests, all passing
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Project Structure
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
aip_protocol/
|
|
229
|
+
├── passport.py # Agent identity + Ed25519 key management
|
|
230
|
+
├── envelope.py # Intent envelope creation + signing
|
|
231
|
+
├── verification.py # 8-step verification pipeline + intent classifier
|
|
232
|
+
├── crypto.py # Ed25519 + HMAC cryptographic layer
|
|
233
|
+
├── errors.py # AIP-Exxx error taxonomy (22 structured codes)
|
|
234
|
+
├── revocation.py # Real-time revocation store with rehydration
|
|
235
|
+
├── trust.py # Bayesian trust score engine
|
|
236
|
+
├── models.py # Protocol data models (Pydantic)
|
|
237
|
+
└── cli.py # Command-line interface
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Design Partners
|
|
241
|
+
|
|
242
|
+
We're onboarding **early design partners** building multi-agent systems. Partners get:
|
|
243
|
+
|
|
244
|
+
- Enterprise-tier API access (free during beta)
|
|
245
|
+
- Direct engineering support
|
|
246
|
+
- Protocol roadmap influence
|
|
247
|
+
|
|
248
|
+
→ **[Apply at aip.synthexai.tech](https://aip.synthexai.tech)**
|
|
249
|
+
|
|
250
|
+
## License
|
|
251
|
+
|
|
252
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
<p align="center">
|
|
257
|
+
<sub><strong>KYA Labs</strong> — Know Your Agent before it acts.</sub><br/>
|
|
258
|
+
<sub><a href="https://aip.synthexai.tech">Website</a> · <a href="https://aip.synthexai.tech/docs">API Docs</a> · <a href="https://pypi.org/project/aip-protocol/">PyPI</a></sub>
|
|
259
|
+
</p>
|