Parent epic: #668
Depends on: #670, #672
Context
“Integration with other modules” must not mean giving Hermes a database connection, admin cookie, unrestricted OpenAPI access, or shell access. The safe boundary is a narrow capability broker with per-agent scopes, schemas, risk classification, anti-replay controls, and audit.
Objective
Add a provider-neutral agent tool gateway that exposes explicitly registered AWCMS capabilities to a Hermes profile without bypassing module services, ABAC, RLS, workflow, idempotency, or audit.
Scope
Capability registry
Each capability declares:
- stable key and owning module;
- description and version;
- request/response JSON schema;
- risk class:
read, draft, mutation, or prohibited;
- required AWCMS permission;
- whether human approval and
Idempotency-Key are mandatory;
- timeout, result-size, and rate limits;
- data classifications accepted/returned;
- enabled deployment/tenant conditions.
Tables/API
awcms_mini_hermes_capabilities
awcms_mini_hermes_module_bindings
awcms_mini_hermes_service_credentials containing hashes/IDs or secret references only
GET /api/v1/hermes/agents/{agentId}/capabilities
POST /api/v1/hermes/tool-calls using dedicated agent service authentication
Initial safe examples
- Read module catalog/health.
- Read aggregate visitor analytics, never raw IP/user-agent by default.
- Read safe audit/operational summaries.
- Create a blog/news draft suggestion, never publish.
- Create an email announcement draft, never dispatch.
- Read workflow tasks visible to the linked actor.
All capability handlers must call existing application services; no direct table shortcut.
Authentication and security
- Dedicated per-agent HMAC/service credential, separate from user session and Hermes API-server key.
- Timestamp, nonce, body hash, maximum skew, replay store, and constant-time verification; reuse the existing sync-HMAC pattern where appropriate.
- Capability allowlist + actor/tenant binding + ABAC/RLS.
- Prompt text is untrusted input; validate structured arguments against schema.
- Reject unknown fields, oversized values, URLs/files outside explicit policy, and secret-shaped content.
- High-risk actions route to workflow approval; no “agent is admin” shortcut.
- Log capability key/status/latency/correlation ID, not raw prompt or secret data.
Acceptance criteria
Out of scope
- General-purpose SQL, shell, filesystem, Docker, or arbitrary URL tools.
- Exposing every OpenAPI endpoint automatically.
- Bypassing module business rules.
Parent epic: #668
Depends on: #670, #672
Context
“Integration with other modules” must not mean giving Hermes a database connection, admin cookie, unrestricted OpenAPI access, or shell access. The safe boundary is a narrow capability broker with per-agent scopes, schemas, risk classification, anti-replay controls, and audit.
Objective
Add a provider-neutral agent tool gateway that exposes explicitly registered AWCMS capabilities to a Hermes profile without bypassing module services, ABAC, RLS, workflow, idempotency, or audit.
Scope
Capability registry
Each capability declares:
read,draft,mutation, orprohibited;Idempotency-Keyare mandatory;Tables/API
awcms_mini_hermes_capabilitiesawcms_mini_hermes_module_bindingsawcms_mini_hermes_service_credentialscontaining hashes/IDs or secret references onlyGET /api/v1/hermes/agents/{agentId}/capabilitiesPOST /api/v1/hermes/tool-callsusing dedicated agent service authenticationInitial safe examples
All capability handlers must call existing application services; no direct table shortcut.
Authentication and security
Acceptance criteria
bun run checkpasses.Out of scope