{"id":50454191,"url":"https://github.com/mizcausevic-dev/identity-mesh","last_synced_at":"2026-06-01T01:05:45.791Z","repository":{"id":356618308,"uuid":"1233118672","full_name":"mizcausevic-dev/identity-mesh","owner":"mizcausevic-dev","description":"SPIFFE-style workload identity broker for AI agents. Short-lived JWT-SVIDs, audience binding, zero long-lived API keys. Zero-trust identity layer for agent fleets.","archived":false,"fork":false,"pushed_at":"2026-05-08T21:24:15.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T23:28:32.559Z","etag":null,"topics":["agent-security","ai-agents","ciso","credential-rotation","jwt-svid","oidc","python","spiffe","workload-identity","zero-trust"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mizcausevic-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-08T16:00:32.000Z","updated_at":"2026-05-08T21:24:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mizcausevic-dev/identity-mesh","commit_stats":null,"previous_names":["mizcausevic-dev/identity-mesh"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mizcausevic-dev/identity-mesh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fidentity-mesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fidentity-mesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fidentity-mesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fidentity-mesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mizcausevic-dev","download_url":"https://codeload.github.com/mizcausevic-dev/identity-mesh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fidentity-mesh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33755379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-security","ai-agents","ciso","credential-rotation","jwt-svid","oidc","python","spiffe","workload-identity","zero-trust"],"created_at":"2026-06-01T01:05:44.545Z","updated_at":"2026-06-01T01:05:45.779Z","avatar_url":"https://github.com/mizcausevic-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# identity-mesh 🔐\n\n\u003e SPIFFE-style workload identity broker for AI agents.\n\u003e Short-lived JWT-SVIDs, audience binding, zero long-lived API keys.\n\n[![CI](https://github.com/mizcausevic-dev/identity-mesh/actions/workflows/ci.yml/badge.svg)](https://github.com/mizcausevic-dev/identity-mesh/actions/workflows/ci.yml)\n![Python](https://img.shields.io/badge/python-3.10%2B-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![Status](https://img.shields.io/badge/status-alpha-orange)\n\n---\n\n## Why\n\nMost AI agents authenticate to downstream services using long-lived API keys\nbaked into environment variables. Compromise one agent -\u003e compromise everything\nthat key could ever touch. Indefinitely. CISO doesn't sleep.\n\n**identity-mesh** issues short-lived (default 5 min), audience-scoped,\ncryptographically signed identities to every agent on demand.\n\n- Steal a token? You have 5 minutes.\n- Steal a key? **There is no key to steal.**\n- Need to revoke an agent? Stop registering it. Existing tokens age out.\n\n## What\n\nFive primitives, SPIFFE-compatible:\n\n| Component | Purpose |\n|---|---|\n| `SPIFFEID` | Parses/validates `spiffe://trust-domain/path` URIs |\n| `IdentityBroker` | Mints JWT-SVIDs (RS256), holds the trust-domain signing key |\n| `Workload` | Agent-side identity holder; caches and auto-refreshes SVIDs |\n| `Verifier` | Service-side validator; checks signature, audience, issuer, expiry |\n| `Rotator` | Background daemon for credential rotation |\n\nBuilt on `pyjwt[crypto]` and `cryptography`. No custom crypto, no surprises.\n\n## Architecture\n\n![Architecture](docs/architecture.svg)\n\n## SVID lifecycle\n\nEach token lives 5 minutes by default - the agent caches it, presents it,\nand refreshes it before expiry. Stolen tokens are obsolete in minutes,\nnot years:\n\n![SVID lifecycle](docs/svid-lifecycle.svg)\n\n## Install\n\n```bash\npip install identity-mesh\n```\n\nOr from source:\n\n```bash\ngit clone https://github.com/mizcausevic-dev/identity-mesh\ncd identity-mesh\npip install -e \".[dev]\"\npytest\n```\n\n## Quickstart\n\n### Full broker -\u003e agent -\u003e service flow\n\n```python\nfrom identity_mesh import IdentityBroker, Workload, Verifier\n\n# Security team operates the broker\nbroker = IdentityBroker(trust_domain=\"prod.kineticgain.com\")\n\n# Register an agent\nagent = Workload(name=\"research-agent-1\", broker=broker)\n\n# Bootstrap downstream service with the trust bundle\nservice = Verifier(\n    trust_domain=\"prod.kineticgain.com\",\n    trust_bundle=broker.trust_bundle(),\n)\n\n# Agent gets a fresh, audience-bound SVID\naudience = \"https://api.kineticgain.com/v1\"\nsvid = agent.get_svid(audience)\n\n# Service verifies - returns the caller's SPIFFE ID\ncaller = service.verify(svid, expected_audience=audience)\n# -\u003e spiffe://prod.kineticgain.com/workload/research-agent-1\n```\n\n### Path-prefix authorization\n\n```python\nif caller.is_under(\"/workload/research-\"):\n    # Allow only research-* agents\n    handle_request(caller)\nelse:\n    raise PermissionError(\"forbidden\")\n```\n\n### Background rotation\n\n```python\nfrom identity_mesh import Rotator\n\n# Refresh SVIDs every 4 minutes (1 min before 5-min expiry)\nrotator = Rotator(\n    interval=240,\n    callback=lambda: agent.get_svid(audience, refresh_before=120),\n)\nrotator.start()\n# ... later\nrotator.stop()\n```\n\n## Buyer\n\n- **CISO / Security** - eliminates long-lived API keys; satisfies SOC2 CC6.6 (logical access)\n- **Platform Engineering** - drop-in zero-trust identity layer for agent fleets\n- **Compliance** - every agent call is cryptographically attributable to a SPIFFE ID\n\n## Pairs With\n\n- [`rate-limit-shield`](https://github.com/mizcausevic-dev/rate-limit-shield) - defense-in-depth: identity at the edge, rate-limits at the model\n- [`agent-router`](https://github.com/mizcausevic-dev/agent-router) - route based on `caller.path` (research vs admin agents)\n- [`agent-canary`](https://github.com/mizcausevic-dev/agent-canary) - identity-based canary cohorts\n- [`model-registry-pro`](https://github.com/mizcausevic-dev/model-registry-pro) - tie approval requesters / approvers to SPIFFE identities\n\n## Roadmap\n\n- [ ] X.509 SVIDs (alongside JWT-SVIDs)\n- [ ] Workload attestation (TPM, K8s service accounts)\n- [ ] gRPC SPIFFE Workload API endpoint\n- [ ] OIDC discovery + JWKS endpoint\n- [ ] HSM / KMS adapter for key custody\n- [ ] Distributed broker (Redis/etcd) for multi-region\n- [ ] PyPI release\n\n## Doctrine\n\n\u003e *\"Long-lived credentials are tomorrow's incident reports.\"*\n\nThree rules:\n\n1. **Short TTL or no TTL.** Five minutes is cheap, breach blast-radius is not.\n2. **Audience-bound.** A token for service A must be useless against service B.\n3. **Rotate the broker key, rotate everyone's trust.** Plan the day-one rotation on day zero.\n\n## Security Notes\n\n- Broker generates a fresh RSA-2048 key per instance. **Persist it** for production\n  (mount from secrets manager or KMS).\n- Default leeway is 5 seconds clock-skew. Tighten in adversarial environments.\n- This library does **not** ship a transport. Pass SVIDs over mTLS or HTTPS only.\n\n## License\n\nMIT - see [LICENSE](./LICENSE).\n\n---\n\nBuilt by [Mirza Causevic](https://github.com/mizcausevic-dev) - Part of the\n[mizcausevic-dev](https://github.com/mizcausevic-dev) AI platform engineering portfolio.\n\n---\n\n**Connect:** [LinkedIn](https://www.linkedin.com/in/mirzacausevic/) · [Kinetic Gain](https://kineticgain.com) · [Medium](https://medium.com/@mizcausevic/) · [Skills](https://mizcausevic.com/skills/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizcausevic-dev%2Fidentity-mesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizcausevic-dev%2Fidentity-mesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizcausevic-dev%2Fidentity-mesh/lists"}