Skip to main content

Per-Grant Binding and Isolation

The security foundation of the Skills Platform is per-grant binding: each user consent grant binds “one Agent + one authorized user + one capability” into an exclusive, non-overlapping triple. This design naturally isolates the data and permissions of different Agents and different users, eliminating the need for a complex centralized permission management system. Core features:
  • Natural isolation: Each consent grant’s user data is only visible to the Agent it is bound to; cross-Agent access is permanently blocked
  • No privilege creep: No special roles like Admin or Super User; permissions are explicit, fixed, and scoped by capability
  • Audit-friendly: Each grant relationship is clear and easy to trace, facilitating log auditing and compliance checks

Two-Layer Authentication

The Skills Platform uses an API Key + user consent grant two-layer authentication mechanism:
  1. API Key — Identifies the Agent (connection layer), managed by the Agent application provider
  2. User consent grant — Identifies one authorized delivery user; one consent grant maps to one user and is valid for 90 days by default, obtained through the binding flow (SMS code / H5)
Each user must authorize in person, once. The platform offers no Admin silent binding — there is no back-office credential that can skip authorization on a user’s behalf (the legacy ADMIN_SECRET / trusted binding has been removed). A user authorization can only be started via request_user_bind (SMS by default / H5) and completed by the user themselves via verify_user_bind.

API Key (Agent Identification)

  • Prefix: Starts with clw_, followed by random characters, e.g. clw_a1b2c3d4...
  • Storage: Server only stores a hash, never plaintext; each request is compared by hash
  • Issuance: Generated when creating an Agent in the Portal, displayed only once — if lost, regenerate it
  • Usage: Passed in the connection-layer HTTP Header as Authorization: Bearer {API_KEY} to identify the calling Agent
  • Prefix: Starts with cg_
  • One-to-one: One consent grant maps to one user (binds an “Agent + user + capability” triple)
  • Validity: 90 days by default; once it expires or rotates, the user must re-bind
  • Source: Obtained after the user authorizes in person through the binding flow (SMS code / H5); verify_user_bind returns consent_grant_id, scopes, and expires_at (ISO 8601) on success
  • Storage: The plaintext is returned only once; only a hash is stored — keep it safe
  • Transport: passed as the consent_grant_id argument on each MCP tool (never in the body, never in a header)
  • Invalidation: Once expires_at is reached, or after being revoked via revoke_user_bind, it becomes invalid immediately; re-bind to obtain a new one

Data Encryption

The Skills Platform applies layered encryption / hashing to all sensitive data, ensuring that even if the database is breached, critical information cannot be directly recovered:
User ID Encryption
  • Algorithm: AES-256-GCM
  • Key: Generated and managed securely by the server
  • Scenario: User ID stored as ciphertext in the database
  • Decryption permission: Only the bound Agent can decrypt its corresponding user data

Agent-User Isolation

The Skills Platform enforces strict isolation policies at the data access layer:
Implementation Details:
  1. Every authorized request carries an API Key and a consent_grant_id
  2. The server verifies the API Key and resolves the agent_id
  3. The server verifies the consent_grant_id, locating the authorized user and its granted capability
  4. Database query condition: WHERE agent_id = ? AND user_id = ?
  5. Any query crossing these two conditions is rejected (a grant for another capability / provider returns CONSENT_GRANT_WRONG_CAP; a capability not enabled returns CAP_NOT_BOUND)
Key milestones:

Authentication Failure Handling

Auth / authorization failures return a uniform {"error": {"code", "message"}} structure with the appropriate HTTP status code:

401 Unauthorized

Missing or invalid credentials
  • Missing API Key (AUTH_REQUIRED)
  • API Key invalid or disabled (AUTH_INVALID)
  • Missing consent_grant_id (CONSENT_GRANT_REQUIRED)
  • consent_grant_id invalid or expired (CONSENT_GRANT_INVALID / CONSENT_GRANT_EXPIRED)

403 Forbidden

No permission to access
  • Grant belongs to another capability / provider (CONSENT_GRANT_WRONG_CAP)
  • This Agent has not enabled the capability (CAP_NOT_BOUND)

429 Too Many Requests

Rate limiting
  • Too many requests within the window (RATE_LIMITED)
  • Each Agent is rate-limited independently (create order 10/min, others 60/min)

Unified error format

{"error": {"code", "message"}}
  • All auth / authorization / business errors share this shape
  • Full error code list in Error Handling
The authentication chain and the auth level required by each endpoint are detailed in Authentication.

Security Best Practices

  • Protect the API Key: Store it in secure environment variables or a key management system, never commit to version control
  • Protect the consent_grant_id: Store the user consent credential securely (plaintext returned only once) — it involves sensitive user data
  • HTTPS only: All communication with the Skills API must use HTTPS
  • Rotation and revocation: Rotate / disable the API Key in the Portal as needed (effective immediately); the consent grant rotates on re-authorization and can be revoked any time via revoke_user_bind
  • Error handling: Catch 401/403 errors and prompt the user to re-authenticate or re-bind

FAQ