Code
Createacme-compliance-agent.py with the code below, or save it directly from your editor.
Skill Configuration
Createskills/public-greet/skill.yaml (advertised on the public catalog):
skills/cbam-line-classify/skill.yaml (only visible to allowlisted DIDs):
skills/public-status/skill.yaml and skills/eudr-due-diligence/skill.yaml) follow the same shape — public ones go into skills, private ones into private_skills.
How It Works
Two-tier skill catalogskills: skills listed here go onGET /.well-known/agent.json, the unauthenticated public agent card every Bindu discovery client reads.private_skills: identical manifest shape, but these only appear onGET /agent/private.json. The public card never mentions them.- The private endpoint returns the merged catalog (public + private) when authorized, so allowlisted partners see the full product surface in one call.
allowed_dids: a list of partner agent DIDs (did:bindu:org:agent:id). Only callers whose request is signed by one of these DIDs get a 200 on/agent/private.json.- No token at all →
401. - Valid token but DID not on the allowlist →
403. - Valid token + allowlisted DID →
200with the merged catalog. - The gate runs on the agent card endpoint, not on
message/send. To gate the handler itself by caller DID, inspect the request context insidehandlerand short-circuit.
expose=False for B2B endpoints
- The example sets
deployment.expose = Falseso the agent stays out of any public Bindu discovery index — it’s intended as a partner-only endpoint that interested parties learn about out-of-band, then fetch/agent/private.jsonto see the real surface.
- Lets you advertise a generic public face (
greet,status) while keeping proprietary capabilities (CBAM classification, EUDR due-diligence) reserved for partners you’ve explicitly authorized. - No fork in the handler logic, no separate agent — same Bindu agent, two visibility tiers on the catalog.
Dependencies
Environment Setup
No environment variables are required to run the demo. To exercise the gated path with real auth, set:AUTH__ENABLED=false the private endpoint is reachable without a token (the gate is skipped); flip auth on to enforce the allowlist.
Run
Example API Calls
Public agent card (anyone)
Public agent card (anyone)
Private agent card (allowlisted DID only)
Private agent card (allowlisted DID only)
allowed_dids:401; with a valid token from a DID not on the allowlist you get 403.Message Send Request
Message Send Request
Task get Request
Task get Request
Frontend Setup
greet, status) — to exercise the private surface, sign requests with a DID on the allowlist.