| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Official Python SDK for MachineID.
MachineID is an enforcement control plane — not an orchestrator. It provides a hard, authoritative allow / deny decision before code executes.
This SDK is designed for AI agents, workers, schedulers, and distributed systems that need centralized execution control without managing infrastructure.
pip install machineid-io
MachineID provides a free organization key with no billing required.
Set it as an environment variable:
export MACHINEID_ORG_KEY=org_your_key_here
from machineid import MachineID
m = MachineID.from_env()
device_id = "agent-01"
# Register device (idempotent)
m.register(device_id)
# HARD GATE — MUST stop execution if denied
decision = m.validate(device_id)
if not decision["allowed"]:
print("Execution denied:", decision["code"], decision["request_id"])
raise SystemExit(1)
print("Execution allowed")
validate() is the enforcement checkpoint.
You must stop execution immediately when:
decision["allowed"] is False
Validate returns authoritative decision metadata:
Example response:
{
"allowed": false,
"code": "DEVICE_REVOKED",
"request_id": "fbf77ff5-06ed-42eb-8e07-024c32ef1e68"
}
This SDK supports:
All calls authenticate via the x-org-key header and return raw API JSON.
This SDK intentionally does NOT:
It is a pure enforcement client.
from machineid import MachineID m = MachineID.from_env()
import machineid print(machineid.__version__)
MIT
| Back | FazBrowse Home | New Git URL |