computeid-sdk 1.0.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ComputeID
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,272 @@
1
+ Metadata-Version: 2.4
2
+ Name: computeid-sdk
3
+ Version: 1.0.0
4
+ Summary: Cryptographic identity for AI compute infrastructure and agentic AI systems
5
+ Home-page: https://github.com/trustedaicompute-ops/computeid-sdk
6
+ Author: ComputeID
7
+ Author-email: hello@compute-id.com
8
+ Keywords: gpu identity certificates quantum-safe ai agents security cryptography
9
+ Classifier: Development Status :: 4 - Beta
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 :: Scientific/Engineering :: Artificial Intelligence
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: requests>=2.28.0
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: keywords
26
+ Dynamic: license-file
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
30
+
31
+ # ComputeID SDK
32
+
33
+ **Cryptographic identity for AI compute infrastructure and agentic AI systems.**
34
+
35
+ > Every GPU needs a passport. Every AI agent needs an identity.
36
+
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
38
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue)](https://pypi.org/project/computeid-sdk/)
39
+ [![compute-id.com](https://img.shields.io/badge/docs-compute--id.com-00b4ff)](https://compute-id.com)
40
+
41
+ ---
42
+
43
+ ## What is ComputeID?
44
+
45
+ ComputeID provides two things:
46
+
47
+ 1. **DeviceID** — Cryptographic passports for GPUs, servers, and compute hardware
48
+ 2. **AgentID** — Cryptographic passports for AI agents and autonomous systems
49
+
50
+ Think of it as a passport system for AI infrastructure. Every device and every agent gets a unique cryptographic identity, a certificate of what it is allowed to do, and an immutable audit trail of everything it has done.
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install computeid-sdk
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Quick Start
63
+
64
+ ### GPU / Device Identity
65
+
66
+ ```python
67
+ from computeid import register_gpu
68
+
69
+ # Register a GPU and get a cryptographic passport
70
+ passport = register_gpu(
71
+ name="NVIDIA A100 #1",
72
+ ip_address="192.168.1.10",
73
+ api_key="your-api-key" # optional for free tier
74
+ )
75
+
76
+ print(passport.device_code) # GPU-001
77
+ print(passport.is_valid()) # True
78
+ ```
79
+
80
+ ### AI Agent Identity
81
+
82
+ ```python
83
+ from computeid import issue_agent_passport
84
+
85
+ # Issue a passport for your AI agent
86
+ passport = issue_agent_passport(
87
+ agent_name="ResearchAgent",
88
+ owner_org="Acme Corp",
89
+ owner_email="admin@acme.com",
90
+ trust_level="standard",
91
+ model="claude-sonnet-4-5"
92
+ )
93
+
94
+ # Check if trusted before giving access
95
+ if passport.is_trusted():
96
+ run_your_agent(passport=passport)
97
+
98
+ # Log every action the agent takes
99
+ passport.log_action("web_search", {"query": "market research"}, "success")
100
+
101
+ # Revoke instantly if needed
102
+ passport.revoke(reason="Unexpected behaviour detected")
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Agent Trust Levels
108
+
109
+ | Level | Description | Use Case |
110
+ |-------|-------------|----------|
111
+ | `restricted` | Read only, human oversight required | Testing, low-risk tasks |
112
+ | `standard` | Web browsing, API calls, file read | Most production agents |
113
+ | `elevated` | Code execution, spawn child agents | Advanced automation |
114
+ | `autonomous` | Full autonomy | Mission-critical systems |
115
+
116
+ ---
117
+
118
+ ## Full Example — Agentic AI with PassportSystem
119
+
120
+ ```python
121
+ from computeid import (
122
+ AgentPassport,
123
+ AgentCapabilities,
124
+ TrustRegistry,
125
+ requires_passport
126
+ )
127
+
128
+ # 1. Create capabilities for your agent
129
+ caps = AgentCapabilities(
130
+ can_browse_web=True,
131
+ can_call_apis=True,
132
+ can_execute_code=False, # not allowed
133
+ trust_level="standard",
134
+ human_in_loop=True,
135
+ max_actions_per_hour=100
136
+ )
137
+
138
+ # 2. Issue a passport
139
+ passport = AgentPassport.issue(
140
+ agent_name="DataAnalysisAgent",
141
+ agent_type="analyst",
142
+ owner_org="Acme Corp",
143
+ owner_email="admin@acme.com",
144
+ capabilities=caps,
145
+ model="claude-sonnet-4-5",
146
+ version="2.1.0"
147
+ )
148
+
149
+ # 3. Protect your functions with passport checks
150
+ @requires_passport(capability="browse_web")
151
+ def search_web(query: str, passport: AgentPassport):
152
+ # This function can only be called by agents
153
+ # with a valid passport that has browse_web capability
154
+ results = do_search(query)
155
+ return results
156
+
157
+ # 4. Call protected function
158
+ results = search_web("GPU rental prices", passport=passport)
159
+
160
+ # 5. View the audit trail
161
+ for entry in passport.get_audit_log():
162
+ print(f"{entry['timestamp']} | {entry['action']} | {entry['outcome']}")
163
+
164
+ # 6. Multi-agent trust chain
165
+ orchestrator = AgentPassport.issue(
166
+ agent_name="OrchestratorAgent",
167
+ agent_type="orchestrator",
168
+ owner_org="Acme Corp",
169
+ owner_email="admin@acme.com",
170
+ capabilities=AgentCapabilities.elevated(),
171
+ model="claude-opus-4-6"
172
+ )
173
+
174
+ # Spawn a child agent — only works if orchestrator has can_spawn_agents=True
175
+ child_agent = AgentPassport.issue(
176
+ agent_name="SubAgent-1",
177
+ agent_type="worker",
178
+ owner_org="Acme Corp",
179
+ owner_email="admin@acme.com",
180
+ capabilities=AgentCapabilities.standard(),
181
+ model="claude-sonnet-4-5",
182
+ parent_passport=orchestrator # establishes trust chain
183
+ )
184
+
185
+ # 7. Organisation-wide trust registry
186
+ registry = TrustRegistry(org_name="Acme Corp")
187
+ registry.register_agent(orchestrator)
188
+ registry.register_agent(child_agent)
189
+
190
+ # Check trust
191
+ if registry.is_trusted(child_agent.agent_id):
192
+ print("Agent is trusted")
193
+
194
+ # Get full audit report
195
+ report = registry.get_audit_report()
196
+ print(f"Total agents: {report['total_agents']}")
197
+ print(f"Active agents: {report['active_agents']}")
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Why Agent Passports Matter
203
+
204
+ The rise of agentic AI creates a new security challenge:
205
+
206
+ - **Who built this agent?** — No way to verify
207
+ - **What is it allowed to do?** — No standard capability model
208
+ - **What has it done?** — No audit trail
209
+ - **Can we stop it?** — No revocation mechanism
210
+ - **Which agents trust each other?** — No trust chain
211
+
212
+ ComputeID AgentID solves all of these with cryptographic guarantees.
213
+
214
+ ---
215
+
216
+ ## Free Tier
217
+
218
+ | Feature | Free | Growth ($499/mo) | Enterprise ($1,999/mo) |
219
+ |---------|------|------------------|------------------------|
220
+ | Device passports | 3 devices | 50 devices | Unlimited |
221
+ | Agent passports | 5 agents | 100 agents | Unlimited |
222
+ | Audit log retention | 7 days | 90 days | 1 year |
223
+ | Quantum-safe certs | ❌ | ✅ | ✅ |
224
+ | Custom CA | ❌ | ❌ | ✅ |
225
+ | API access | ✅ | ✅ | ✅ |
226
+
227
+ **Get started free at [compute-id.com](https://compute-id.com)**
228
+
229
+ ---
230
+
231
+ ## Regulatory Compliance
232
+
233
+ ComputeID helps you meet:
234
+
235
+ - **EU AI Act** — requires audit trails for high-risk AI systems
236
+ - **NIST AI RMF** — AI risk management framework
237
+ - **SOC2 Type II** — compute infrastructure audit logs
238
+ - **NSA CNSA 2.0** — post-quantum cryptography by 2030
239
+
240
+ ---
241
+
242
+ ## Contributing
243
+
244
+ ComputeID SDK is open source under the MIT license.
245
+
246
+ We welcome contributions — especially:
247
+ - Client libraries for other languages (Go, Rust, Java)
248
+ - Integration examples with popular AI frameworks
249
+ - Protocol specification improvements
250
+
251
+ ```bash
252
+ git clone https://github.com/trustedaicompute-ops/computeid-sdk
253
+ cd computeid-sdk
254
+ pip install -e ".[dev]"
255
+ ```
256
+
257
+ ---
258
+
259
+ ## Links
260
+
261
+ - **Website:** [compute-id.com](https://compute-id.com)
262
+ - **Dashboard:** [aicomputeid.com](https://aicomputeid.com)
263
+ - **GitHub:** [github.com/trustedaicompute-ops](https://github.com/trustedaicompute-ops)
264
+ - **Email:** hello@compute-id.com
265
+
266
+ ---
267
+
268
+ ## License
269
+
270
+ MIT License — free to use, modify and distribute.
271
+
272
+ Copyright 2026 ComputeID / TrustedAI Compute
@@ -0,0 +1,242 @@
1
+ # ComputeID SDK
2
+
3
+ **Cryptographic identity for AI compute infrastructure and agentic AI systems.**
4
+
5
+ > Every GPU needs a passport. Every AI agent needs an identity.
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue)](https://pypi.org/project/computeid-sdk/)
9
+ [![compute-id.com](https://img.shields.io/badge/docs-compute--id.com-00b4ff)](https://compute-id.com)
10
+
11
+ ---
12
+
13
+ ## What is ComputeID?
14
+
15
+ ComputeID provides two things:
16
+
17
+ 1. **DeviceID** — Cryptographic passports for GPUs, servers, and compute hardware
18
+ 2. **AgentID** — Cryptographic passports for AI agents and autonomous systems
19
+
20
+ Think of it as a passport system for AI infrastructure. Every device and every agent gets a unique cryptographic identity, a certificate of what it is allowed to do, and an immutable audit trail of everything it has done.
21
+
22
+ ---
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install computeid-sdk
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Quick Start
33
+
34
+ ### GPU / Device Identity
35
+
36
+ ```python
37
+ from computeid import register_gpu
38
+
39
+ # Register a GPU and get a cryptographic passport
40
+ passport = register_gpu(
41
+ name="NVIDIA A100 #1",
42
+ ip_address="192.168.1.10",
43
+ api_key="your-api-key" # optional for free tier
44
+ )
45
+
46
+ print(passport.device_code) # GPU-001
47
+ print(passport.is_valid()) # True
48
+ ```
49
+
50
+ ### AI Agent Identity
51
+
52
+ ```python
53
+ from computeid import issue_agent_passport
54
+
55
+ # Issue a passport for your AI agent
56
+ passport = issue_agent_passport(
57
+ agent_name="ResearchAgent",
58
+ owner_org="Acme Corp",
59
+ owner_email="admin@acme.com",
60
+ trust_level="standard",
61
+ model="claude-sonnet-4-5"
62
+ )
63
+
64
+ # Check if trusted before giving access
65
+ if passport.is_trusted():
66
+ run_your_agent(passport=passport)
67
+
68
+ # Log every action the agent takes
69
+ passport.log_action("web_search", {"query": "market research"}, "success")
70
+
71
+ # Revoke instantly if needed
72
+ passport.revoke(reason="Unexpected behaviour detected")
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Agent Trust Levels
78
+
79
+ | Level | Description | Use Case |
80
+ |-------|-------------|----------|
81
+ | `restricted` | Read only, human oversight required | Testing, low-risk tasks |
82
+ | `standard` | Web browsing, API calls, file read | Most production agents |
83
+ | `elevated` | Code execution, spawn child agents | Advanced automation |
84
+ | `autonomous` | Full autonomy | Mission-critical systems |
85
+
86
+ ---
87
+
88
+ ## Full Example — Agentic AI with PassportSystem
89
+
90
+ ```python
91
+ from computeid import (
92
+ AgentPassport,
93
+ AgentCapabilities,
94
+ TrustRegistry,
95
+ requires_passport
96
+ )
97
+
98
+ # 1. Create capabilities for your agent
99
+ caps = AgentCapabilities(
100
+ can_browse_web=True,
101
+ can_call_apis=True,
102
+ can_execute_code=False, # not allowed
103
+ trust_level="standard",
104
+ human_in_loop=True,
105
+ max_actions_per_hour=100
106
+ )
107
+
108
+ # 2. Issue a passport
109
+ passport = AgentPassport.issue(
110
+ agent_name="DataAnalysisAgent",
111
+ agent_type="analyst",
112
+ owner_org="Acme Corp",
113
+ owner_email="admin@acme.com",
114
+ capabilities=caps,
115
+ model="claude-sonnet-4-5",
116
+ version="2.1.0"
117
+ )
118
+
119
+ # 3. Protect your functions with passport checks
120
+ @requires_passport(capability="browse_web")
121
+ def search_web(query: str, passport: AgentPassport):
122
+ # This function can only be called by agents
123
+ # with a valid passport that has browse_web capability
124
+ results = do_search(query)
125
+ return results
126
+
127
+ # 4. Call protected function
128
+ results = search_web("GPU rental prices", passport=passport)
129
+
130
+ # 5. View the audit trail
131
+ for entry in passport.get_audit_log():
132
+ print(f"{entry['timestamp']} | {entry['action']} | {entry['outcome']}")
133
+
134
+ # 6. Multi-agent trust chain
135
+ orchestrator = AgentPassport.issue(
136
+ agent_name="OrchestratorAgent",
137
+ agent_type="orchestrator",
138
+ owner_org="Acme Corp",
139
+ owner_email="admin@acme.com",
140
+ capabilities=AgentCapabilities.elevated(),
141
+ model="claude-opus-4-6"
142
+ )
143
+
144
+ # Spawn a child agent — only works if orchestrator has can_spawn_agents=True
145
+ child_agent = AgentPassport.issue(
146
+ agent_name="SubAgent-1",
147
+ agent_type="worker",
148
+ owner_org="Acme Corp",
149
+ owner_email="admin@acme.com",
150
+ capabilities=AgentCapabilities.standard(),
151
+ model="claude-sonnet-4-5",
152
+ parent_passport=orchestrator # establishes trust chain
153
+ )
154
+
155
+ # 7. Organisation-wide trust registry
156
+ registry = TrustRegistry(org_name="Acme Corp")
157
+ registry.register_agent(orchestrator)
158
+ registry.register_agent(child_agent)
159
+
160
+ # Check trust
161
+ if registry.is_trusted(child_agent.agent_id):
162
+ print("Agent is trusted")
163
+
164
+ # Get full audit report
165
+ report = registry.get_audit_report()
166
+ print(f"Total agents: {report['total_agents']}")
167
+ print(f"Active agents: {report['active_agents']}")
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Why Agent Passports Matter
173
+
174
+ The rise of agentic AI creates a new security challenge:
175
+
176
+ - **Who built this agent?** — No way to verify
177
+ - **What is it allowed to do?** — No standard capability model
178
+ - **What has it done?** — No audit trail
179
+ - **Can we stop it?** — No revocation mechanism
180
+ - **Which agents trust each other?** — No trust chain
181
+
182
+ ComputeID AgentID solves all of these with cryptographic guarantees.
183
+
184
+ ---
185
+
186
+ ## Free Tier
187
+
188
+ | Feature | Free | Growth ($499/mo) | Enterprise ($1,999/mo) |
189
+ |---------|------|------------------|------------------------|
190
+ | Device passports | 3 devices | 50 devices | Unlimited |
191
+ | Agent passports | 5 agents | 100 agents | Unlimited |
192
+ | Audit log retention | 7 days | 90 days | 1 year |
193
+ | Quantum-safe certs | ❌ | ✅ | ✅ |
194
+ | Custom CA | ❌ | ❌ | ✅ |
195
+ | API access | ✅ | ✅ | ✅ |
196
+
197
+ **Get started free at [compute-id.com](https://compute-id.com)**
198
+
199
+ ---
200
+
201
+ ## Regulatory Compliance
202
+
203
+ ComputeID helps you meet:
204
+
205
+ - **EU AI Act** — requires audit trails for high-risk AI systems
206
+ - **NIST AI RMF** — AI risk management framework
207
+ - **SOC2 Type II** — compute infrastructure audit logs
208
+ - **NSA CNSA 2.0** — post-quantum cryptography by 2030
209
+
210
+ ---
211
+
212
+ ## Contributing
213
+
214
+ ComputeID SDK is open source under the MIT license.
215
+
216
+ We welcome contributions — especially:
217
+ - Client libraries for other languages (Go, Rust, Java)
218
+ - Integration examples with popular AI frameworks
219
+ - Protocol specification improvements
220
+
221
+ ```bash
222
+ git clone https://github.com/trustedaicompute-ops/computeid-sdk
223
+ cd computeid-sdk
224
+ pip install -e ".[dev]"
225
+ ```
226
+
227
+ ---
228
+
229
+ ## Links
230
+
231
+ - **Website:** [compute-id.com](https://compute-id.com)
232
+ - **Dashboard:** [aicomputeid.com](https://aicomputeid.com)
233
+ - **GitHub:** [github.com/trustedaicompute-ops](https://github.com/trustedaicompute-ops)
234
+ - **Email:** hello@compute-id.com
235
+
236
+ ---
237
+
238
+ ## License
239
+
240
+ MIT License — free to use, modify and distribute.
241
+
242
+ Copyright 2026 ComputeID / TrustedAI Compute
@@ -0,0 +1,325 @@
1
+ """
2
+ ComputeID SDK v1.0.0
3
+ Cryptographic identity for AI compute and agentic AI systems.
4
+ https://compute-id.com
5
+ """
6
+
7
+ import hashlib
8
+ import json
9
+ import uuid
10
+ import requests
11
+ from datetime import datetime, timedelta
12
+ from typing import Optional, Dict, List, Any
13
+
14
+ COMPUTEID_API = "https://api.aicomputeid.com"
15
+ SDK_VERSION = "1.0.0"
16
+
17
+ class ComputeIDError(Exception): pass
18
+ class AuthenticationError(ComputeIDError): pass
19
+ class RegistrationError(ComputeIDError): pass
20
+ class RevocationError(ComputeIDError): pass
21
+ class TrustError(ComputeIDError): pass
22
+
23
+ class AgentCapabilities:
24
+ def __init__(self, can_browse_web=False, can_execute_code=False,
25
+ can_access_files=False, can_call_apis=True, can_spawn_agents=False,
26
+ can_access_database=False, can_send_email=False,
27
+ max_actions_per_hour=100, trust_level="restricted",
28
+ human_in_loop=True, allowed_domains=None, allowed_tools=None,
29
+ max_token_budget=None, custom_permissions=None, **kwargs):
30
+ self.can_browse_web = can_browse_web
31
+ self.can_execute_code = can_execute_code
32
+ self.can_access_files = can_access_files
33
+ self.can_call_apis = can_call_apis
34
+ self.can_spawn_agents = can_spawn_agents
35
+ self.can_access_database = can_access_database
36
+ self.can_send_email = can_send_email
37
+ self.max_actions_per_hour = max_actions_per_hour
38
+ self.trust_level = trust_level
39
+ self.human_in_loop = human_in_loop
40
+ self.allowed_domains = allowed_domains or []
41
+ self.allowed_tools = allowed_tools or []
42
+ self.max_token_budget = max_token_budget
43
+ self.custom_permissions = custom_permissions or {}
44
+
45
+ def to_dict(self):
46
+ return self.__dict__
47
+
48
+ @classmethod
49
+ def restricted(cls):
50
+ return cls(trust_level="restricted", human_in_loop=True, max_actions_per_hour=50)
51
+
52
+ @classmethod
53
+ def standard(cls):
54
+ return cls(can_browse_web=True, can_call_apis=True, can_access_files=True,
55
+ trust_level="standard", human_in_loop=True, max_actions_per_hour=200)
56
+
57
+ @classmethod
58
+ def elevated(cls):
59
+ return cls(can_browse_web=True, can_execute_code=True, can_call_apis=True,
60
+ can_access_files=True, can_spawn_agents=True,
61
+ trust_level="elevated", human_in_loop=False, max_actions_per_hour=1000)
62
+
63
+ @classmethod
64
+ def autonomous(cls):
65
+ return cls(can_browse_web=True, can_execute_code=True, can_call_apis=True,
66
+ can_access_files=True, can_spawn_agents=True,
67
+ can_access_database=True, can_send_email=True,
68
+ trust_level="autonomous", human_in_loop=False, max_actions_per_hour=10000)
69
+
70
+
71
+ class AgentPassport:
72
+ def __init__(self, data):
73
+ self.agent_id = data.get("agent_id", str(uuid.uuid4()))
74
+ self.agent_name = data.get("agent_name")
75
+ self.agent_type = data.get("agent_type")
76
+ self.owner_org = data.get("owner_org")
77
+ self.owner_email = data.get("owner_email")
78
+ self.model = data.get("model")
79
+ self.version = data.get("version", "1.0.0")
80
+ self.status = data.get("status", "active")
81
+ self.trust_level = data.get("trust_level", "restricted")
82
+ self.parent_agent_id = data.get("parent_agent_id")
83
+ self.issued_at = data.get("issued_at", datetime.utcnow().isoformat())
84
+ self.expires_at = data.get("expires_at")
85
+ self.revoked_at = data.get("revoked_at")
86
+ self.revoke_reason = data.get("revoke_reason")
87
+ caps = data.get("capabilities", {})
88
+ self.capabilities = AgentCapabilities(**caps) if isinstance(caps, dict) else caps
89
+ self._audit_log = data.get("audit_log", [])
90
+ self._fingerprint = hashlib.sha256(
91
+ f"{self.agent_id}{self.agent_name}{self.owner_org}{self.issued_at}".encode()
92
+ ).hexdigest()[:16]
93
+
94
+ @classmethod
95
+ def issue(cls, agent_name, agent_type, owner_org, owner_email,
96
+ capabilities, model="unknown", version="1.0.0",
97
+ parent_passport=None, expires_in_hours=24,
98
+ api_key=None, api_url=COMPUTEID_API):
99
+ if parent_passport:
100
+ if not parent_passport.capabilities.can_spawn_agents:
101
+ raise TrustError("Parent agent cannot spawn child agents")
102
+ if not parent_passport.is_trusted():
103
+ raise TrustError("Parent agent is not trusted")
104
+ now = datetime.utcnow()
105
+ data = {
106
+ "agent_id": str(uuid.uuid4()),
107
+ "agent_name": agent_name,
108
+ "agent_type": agent_type,
109
+ "owner_org": owner_org,
110
+ "owner_email": owner_email,
111
+ "model": model,
112
+ "version": version,
113
+ "status": "active",
114
+ "trust_level": capabilities.trust_level,
115
+ "parent_agent_id": parent_passport.agent_id if parent_passport else None,
116
+ "issued_at": now.isoformat(),
117
+ "expires_at": (now + timedelta(hours=expires_in_hours)).isoformat(),
118
+ "capabilities": capabilities.to_dict(),
119
+ "audit_log": [],
120
+ }
121
+ passport = cls(data)
122
+ passport.log_action("passport_issued", {"agent_name": agent_name}, "success")
123
+ return passport
124
+
125
+ def log_action(self, action, details=None, outcome="success"):
126
+ entry = {
127
+ "log_id": str(uuid.uuid4()),
128
+ "agent_id": self.agent_id,
129
+ "action": action,
130
+ "details": details or {},
131
+ "outcome": outcome,
132
+ "timestamp": datetime.utcnow().isoformat(),
133
+ }
134
+ self._audit_log.append(entry)
135
+ return entry
136
+
137
+ def verify_action(self, action):
138
+ if not self.is_trusted():
139
+ self.log_action(action, outcome="blocked", details={"reason": "passport_invalid"})
140
+ return False
141
+ action_map = {
142
+ "browse_web": self.capabilities.can_browse_web,
143
+ "execute_code": self.capabilities.can_execute_code,
144
+ "access_files": self.capabilities.can_access_files,
145
+ "call_api": self.capabilities.can_call_apis,
146
+ "spawn_agent": self.capabilities.can_spawn_agents,
147
+ "access_database": self.capabilities.can_access_database,
148
+ "send_email": self.capabilities.can_send_email,
149
+ }
150
+ allowed = action_map.get(action, False)
151
+ if not allowed:
152
+ self.log_action(action, outcome="blocked", details={"reason": "capability_not_granted"})
153
+ return allowed
154
+
155
+ def revoke(self, reason="Manual revocation"):
156
+ self.status = "revoked"
157
+ self.revoked_at = datetime.utcnow().isoformat()
158
+ self.revoke_reason = reason
159
+ self.log_action("passport_revoked", {"reason": reason}, "success")
160
+
161
+ def is_trusted(self):
162
+ if self.status != "active":
163
+ return False
164
+ if self.expires_at:
165
+ expires = datetime.fromisoformat(self.expires_at.replace("Z", ""))
166
+ if datetime.utcnow() > expires:
167
+ self.status = "expired"
168
+ return False
169
+ return True
170
+
171
+ def get_audit_log(self):
172
+ return self._audit_log.copy()
173
+
174
+ def get_summary(self):
175
+ return {
176
+ "agent_id": self.agent_id,
177
+ "agent_name": self.agent_name,
178
+ "owner_org": self.owner_org,
179
+ "model": self.model,
180
+ "status": self.status,
181
+ "trust_level": self.trust_level,
182
+ "issued_at": self.issued_at,
183
+ "expires_at": self.expires_at,
184
+ "actions_logged": len(self._audit_log),
185
+ "fingerprint": self._fingerprint,
186
+ }
187
+
188
+ def export(self):
189
+ data = self.get_summary()
190
+ data["capabilities"] = self.capabilities.to_dict()
191
+ data["audit_log"] = self._audit_log
192
+ return json.dumps(data, indent=2)
193
+
194
+ @classmethod
195
+ def load(cls, json_str):
196
+ return cls(json.loads(json_str))
197
+
198
+ def __repr__(self):
199
+ return f"<AgentPassport {self.agent_id[:8]}... | {self.agent_name} | {self.trust_level} | {self.status}>"
200
+
201
+
202
+ class DevicePassport:
203
+ def __init__(self, data):
204
+ self.device_id = data.get("device_id")
205
+ self.device_code = data.get("device_code")
206
+ self.name = data.get("name")
207
+ self.device_type = data.get("type")
208
+ self.ip_address = data.get("ip_address")
209
+ self.status = data.get("status", "pending")
210
+ self.issued_at = data.get("issued_at", datetime.utcnow().isoformat())
211
+
212
+ @classmethod
213
+ def register(cls, name, device_type, ip_address, api_key=None, api_url=COMPUTEID_API):
214
+ headers = {"Content-Type": "application/json"}
215
+ if api_key:
216
+ headers["X-API-Key"] = api_key
217
+ try:
218
+ res = requests.post(f"{api_url}/api/devices/register",
219
+ json={"name": name, "type": device_type, "ip_address": ip_address},
220
+ headers=headers, timeout=30)
221
+ data = res.json()
222
+ if not res.ok:
223
+ raise RegistrationError(data.get("error", "Registration failed"))
224
+ return cls(data)
225
+ except requests.RequestException as e:
226
+ raise RegistrationError(f"Network error: {e}")
227
+
228
+ @classmethod
229
+ def authenticate(cls, device_code, api_url=COMPUTEID_API):
230
+ try:
231
+ res = requests.post(f"{api_url}/api/devices/authenticate",
232
+ json={"device_code": device_code},
233
+ headers={"Content-Type": "application/json"}, timeout=30)
234
+ data = res.json()
235
+ if not res.ok:
236
+ raise AuthenticationError(data.get("error", "Authentication failed"))
237
+ return data.get("access_token")
238
+ except requests.RequestException as e:
239
+ raise AuthenticationError(f"Network error: {e}")
240
+
241
+ def is_valid(self):
242
+ return self.status == "active"
243
+
244
+ def __repr__(self):
245
+ return f"<DevicePassport {self.device_code} | {self.name} | {self.status}>"
246
+
247
+
248
+ class TrustRegistry:
249
+ def __init__(self, org_name, api_key=None):
250
+ self.org_name = org_name
251
+ self.api_key = api_key
252
+ self._agents = {}
253
+ self._devices = {}
254
+
255
+ def register_agent(self, passport):
256
+ self._agents[passport.agent_id] = passport
257
+
258
+ def register_device(self, passport):
259
+ if passport.device_id:
260
+ self._devices[passport.device_id] = passport
261
+
262
+ def is_trusted(self, agent_id):
263
+ passport = self._agents.get(agent_id)
264
+ return passport.is_trusted() if passport else False
265
+
266
+ def revoke_agent(self, agent_id, reason="Revoked by registry"):
267
+ passport = self._agents.get(agent_id)
268
+ if passport:
269
+ passport.revoke(reason)
270
+ return True
271
+ return False
272
+
273
+ def get_active_agents(self):
274
+ return [p for p in self._agents.values() if p.is_trusted()]
275
+
276
+ def get_audit_report(self):
277
+ return {
278
+ "org_name": self.org_name,
279
+ "generated_at": datetime.utcnow().isoformat(),
280
+ "total_agents": len(self._agents),
281
+ "active_agents": len(self.get_active_agents()),
282
+ "total_devices": len(self._devices),
283
+ "agents": [{**p.get_summary(), "audit_log": p.get_audit_log()}
284
+ for p in self._agents.values()]
285
+ }
286
+
287
+ def __repr__(self):
288
+ return f"<TrustRegistry {self.org_name} | {len(self._agents)} agents>"
289
+
290
+
291
+ def requires_passport(capability=None):
292
+ def decorator(func):
293
+ def wrapper(*args, passport=None, **kwargs):
294
+ if passport is None:
295
+ raise AuthenticationError(f"{func.__name__} requires an AgentPassport")
296
+ if not passport.is_trusted():
297
+ raise AuthenticationError(f"Passport for {passport.agent_name} is not trusted")
298
+ if capability and not passport.verify_action(capability):
299
+ raise TrustError(f"Agent lacks {capability} capability")
300
+ passport.log_action(func.__name__, outcome="success")
301
+ return func(*args, passport=passport, **kwargs)
302
+ wrapper.__name__ = func.__name__
303
+ return wrapper
304
+ return decorator
305
+
306
+
307
+ def issue_agent_passport(agent_name, owner_org, owner_email,
308
+ trust_level="standard", model="unknown", api_key=None):
309
+ caps_map = {
310
+ "restricted": AgentCapabilities.restricted(),
311
+ "standard": AgentCapabilities.standard(),
312
+ "elevated": AgentCapabilities.elevated(),
313
+ "autonomous": AgentCapabilities.autonomous(),
314
+ }
315
+ return AgentPassport.issue(
316
+ agent_name=agent_name, agent_type="general",
317
+ owner_org=owner_org, owner_email=owner_email,
318
+ capabilities=caps_map.get(trust_level, AgentCapabilities.standard()),
319
+ model=model, api_key=api_key
320
+ )
321
+
322
+
323
+ def register_gpu(name, ip_address, api_key=None):
324
+ return DevicePassport.register(name=name, device_type="GPU",
325
+ ip_address=ip_address, api_key=api_key)
@@ -0,0 +1,272 @@
1
+ Metadata-Version: 2.4
2
+ Name: computeid-sdk
3
+ Version: 1.0.0
4
+ Summary: Cryptographic identity for AI compute infrastructure and agentic AI systems
5
+ Home-page: https://github.com/trustedaicompute-ops/computeid-sdk
6
+ Author: ComputeID
7
+ Author-email: hello@compute-id.com
8
+ Keywords: gpu identity certificates quantum-safe ai agents security cryptography
9
+ Classifier: Development Status :: 4 - Beta
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 :: Scientific/Engineering :: Artificial Intelligence
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: requests>=2.28.0
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: keywords
26
+ Dynamic: license-file
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
30
+
31
+ # ComputeID SDK
32
+
33
+ **Cryptographic identity for AI compute infrastructure and agentic AI systems.**
34
+
35
+ > Every GPU needs a passport. Every AI agent needs an identity.
36
+
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
38
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue)](https://pypi.org/project/computeid-sdk/)
39
+ [![compute-id.com](https://img.shields.io/badge/docs-compute--id.com-00b4ff)](https://compute-id.com)
40
+
41
+ ---
42
+
43
+ ## What is ComputeID?
44
+
45
+ ComputeID provides two things:
46
+
47
+ 1. **DeviceID** — Cryptographic passports for GPUs, servers, and compute hardware
48
+ 2. **AgentID** — Cryptographic passports for AI agents and autonomous systems
49
+
50
+ Think of it as a passport system for AI infrastructure. Every device and every agent gets a unique cryptographic identity, a certificate of what it is allowed to do, and an immutable audit trail of everything it has done.
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install computeid-sdk
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Quick Start
63
+
64
+ ### GPU / Device Identity
65
+
66
+ ```python
67
+ from computeid import register_gpu
68
+
69
+ # Register a GPU and get a cryptographic passport
70
+ passport = register_gpu(
71
+ name="NVIDIA A100 #1",
72
+ ip_address="192.168.1.10",
73
+ api_key="your-api-key" # optional for free tier
74
+ )
75
+
76
+ print(passport.device_code) # GPU-001
77
+ print(passport.is_valid()) # True
78
+ ```
79
+
80
+ ### AI Agent Identity
81
+
82
+ ```python
83
+ from computeid import issue_agent_passport
84
+
85
+ # Issue a passport for your AI agent
86
+ passport = issue_agent_passport(
87
+ agent_name="ResearchAgent",
88
+ owner_org="Acme Corp",
89
+ owner_email="admin@acme.com",
90
+ trust_level="standard",
91
+ model="claude-sonnet-4-5"
92
+ )
93
+
94
+ # Check if trusted before giving access
95
+ if passport.is_trusted():
96
+ run_your_agent(passport=passport)
97
+
98
+ # Log every action the agent takes
99
+ passport.log_action("web_search", {"query": "market research"}, "success")
100
+
101
+ # Revoke instantly if needed
102
+ passport.revoke(reason="Unexpected behaviour detected")
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Agent Trust Levels
108
+
109
+ | Level | Description | Use Case |
110
+ |-------|-------------|----------|
111
+ | `restricted` | Read only, human oversight required | Testing, low-risk tasks |
112
+ | `standard` | Web browsing, API calls, file read | Most production agents |
113
+ | `elevated` | Code execution, spawn child agents | Advanced automation |
114
+ | `autonomous` | Full autonomy | Mission-critical systems |
115
+
116
+ ---
117
+
118
+ ## Full Example — Agentic AI with PassportSystem
119
+
120
+ ```python
121
+ from computeid import (
122
+ AgentPassport,
123
+ AgentCapabilities,
124
+ TrustRegistry,
125
+ requires_passport
126
+ )
127
+
128
+ # 1. Create capabilities for your agent
129
+ caps = AgentCapabilities(
130
+ can_browse_web=True,
131
+ can_call_apis=True,
132
+ can_execute_code=False, # not allowed
133
+ trust_level="standard",
134
+ human_in_loop=True,
135
+ max_actions_per_hour=100
136
+ )
137
+
138
+ # 2. Issue a passport
139
+ passport = AgentPassport.issue(
140
+ agent_name="DataAnalysisAgent",
141
+ agent_type="analyst",
142
+ owner_org="Acme Corp",
143
+ owner_email="admin@acme.com",
144
+ capabilities=caps,
145
+ model="claude-sonnet-4-5",
146
+ version="2.1.0"
147
+ )
148
+
149
+ # 3. Protect your functions with passport checks
150
+ @requires_passport(capability="browse_web")
151
+ def search_web(query: str, passport: AgentPassport):
152
+ # This function can only be called by agents
153
+ # with a valid passport that has browse_web capability
154
+ results = do_search(query)
155
+ return results
156
+
157
+ # 4. Call protected function
158
+ results = search_web("GPU rental prices", passport=passport)
159
+
160
+ # 5. View the audit trail
161
+ for entry in passport.get_audit_log():
162
+ print(f"{entry['timestamp']} | {entry['action']} | {entry['outcome']}")
163
+
164
+ # 6. Multi-agent trust chain
165
+ orchestrator = AgentPassport.issue(
166
+ agent_name="OrchestratorAgent",
167
+ agent_type="orchestrator",
168
+ owner_org="Acme Corp",
169
+ owner_email="admin@acme.com",
170
+ capabilities=AgentCapabilities.elevated(),
171
+ model="claude-opus-4-6"
172
+ )
173
+
174
+ # Spawn a child agent — only works if orchestrator has can_spawn_agents=True
175
+ child_agent = AgentPassport.issue(
176
+ agent_name="SubAgent-1",
177
+ agent_type="worker",
178
+ owner_org="Acme Corp",
179
+ owner_email="admin@acme.com",
180
+ capabilities=AgentCapabilities.standard(),
181
+ model="claude-sonnet-4-5",
182
+ parent_passport=orchestrator # establishes trust chain
183
+ )
184
+
185
+ # 7. Organisation-wide trust registry
186
+ registry = TrustRegistry(org_name="Acme Corp")
187
+ registry.register_agent(orchestrator)
188
+ registry.register_agent(child_agent)
189
+
190
+ # Check trust
191
+ if registry.is_trusted(child_agent.agent_id):
192
+ print("Agent is trusted")
193
+
194
+ # Get full audit report
195
+ report = registry.get_audit_report()
196
+ print(f"Total agents: {report['total_agents']}")
197
+ print(f"Active agents: {report['active_agents']}")
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Why Agent Passports Matter
203
+
204
+ The rise of agentic AI creates a new security challenge:
205
+
206
+ - **Who built this agent?** — No way to verify
207
+ - **What is it allowed to do?** — No standard capability model
208
+ - **What has it done?** — No audit trail
209
+ - **Can we stop it?** — No revocation mechanism
210
+ - **Which agents trust each other?** — No trust chain
211
+
212
+ ComputeID AgentID solves all of these with cryptographic guarantees.
213
+
214
+ ---
215
+
216
+ ## Free Tier
217
+
218
+ | Feature | Free | Growth ($499/mo) | Enterprise ($1,999/mo) |
219
+ |---------|------|------------------|------------------------|
220
+ | Device passports | 3 devices | 50 devices | Unlimited |
221
+ | Agent passports | 5 agents | 100 agents | Unlimited |
222
+ | Audit log retention | 7 days | 90 days | 1 year |
223
+ | Quantum-safe certs | ❌ | ✅ | ✅ |
224
+ | Custom CA | ❌ | ❌ | ✅ |
225
+ | API access | ✅ | ✅ | ✅ |
226
+
227
+ **Get started free at [compute-id.com](https://compute-id.com)**
228
+
229
+ ---
230
+
231
+ ## Regulatory Compliance
232
+
233
+ ComputeID helps you meet:
234
+
235
+ - **EU AI Act** — requires audit trails for high-risk AI systems
236
+ - **NIST AI RMF** — AI risk management framework
237
+ - **SOC2 Type II** — compute infrastructure audit logs
238
+ - **NSA CNSA 2.0** — post-quantum cryptography by 2030
239
+
240
+ ---
241
+
242
+ ## Contributing
243
+
244
+ ComputeID SDK is open source under the MIT license.
245
+
246
+ We welcome contributions — especially:
247
+ - Client libraries for other languages (Go, Rust, Java)
248
+ - Integration examples with popular AI frameworks
249
+ - Protocol specification improvements
250
+
251
+ ```bash
252
+ git clone https://github.com/trustedaicompute-ops/computeid-sdk
253
+ cd computeid-sdk
254
+ pip install -e ".[dev]"
255
+ ```
256
+
257
+ ---
258
+
259
+ ## Links
260
+
261
+ - **Website:** [compute-id.com](https://compute-id.com)
262
+ - **Dashboard:** [aicomputeid.com](https://aicomputeid.com)
263
+ - **GitHub:** [github.com/trustedaicompute-ops](https://github.com/trustedaicompute-ops)
264
+ - **Email:** hello@compute-id.com
265
+
266
+ ---
267
+
268
+ ## License
269
+
270
+ MIT License — free to use, modify and distribute.
271
+
272
+ Copyright 2026 ComputeID / TrustedAI Compute
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ computeid.py
4
+ setup.py
5
+ computeid_sdk.egg-info/PKG-INFO
6
+ computeid_sdk.egg-info/SOURCES.txt
7
+ computeid_sdk.egg-info/dependency_links.txt
8
+ computeid_sdk.egg-info/requires.txt
9
+ computeid_sdk.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests>=2.28.0
@@ -0,0 +1 @@
1
+ computeid
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,24 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="computeid-sdk",
5
+ version="1.0.0",
6
+ description="Cryptographic identity for AI compute infrastructure and agentic AI systems",
7
+ long_description=open("README.md").read(),
8
+ long_description_content_type="text/markdown",
9
+ author="ComputeID",
10
+ author_email="hello@compute-id.com",
11
+ url="https://github.com/trustedaicompute-ops/computeid-sdk",
12
+ py_modules=["computeid"],
13
+ install_requires=["requests>=2.28.0"],
14
+ python_requires=">=3.8",
15
+ classifiers=[
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Security :: Cryptography",
21
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
22
+ ],
23
+ keywords="gpu identity certificates quantum-safe ai agents security cryptography",
24
+ )