Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

PENDING: feat(hermes-agent): scaffold module, tenant schema, RLS, RBAC, and agent registry API #670

Description

@ahliweb

Parent epic: #668
Depends on: #669

Context

The validated architecture requires a small tenant-aware control-plane registry before any provider or Telegram integration is added. Existing tenant, identity, module-management, audit, soft-delete, and RLS foundations must be reused.

Objective

Add the hermes_agent system module and the minimum schema/API needed to register Hermes profiles and their trusted endpoints without storing runtime credentials.

Scope

Module descriptor

  • Key: hermes_agent
  • Type: system
  • API base: /api/v1/hermes
  • Admin route reserved for later: /admin/hermes
  • Dependencies: tenant_admin, identity_access, profile_identity, module_management, logging, reporting, workflow
  • Full-online-only configuration gate.

Tables

  • awcms_mini_hermes_agents
  • awcms_mini_hermes_endpoints

Minimum agent fields:

  • tenant/profile ownership and display name;
  • stable profile key;
  • purpose and environment;
  • desired provider/model references;
  • lifecycle state;
  • operator-managed deployment reference;
  • created/updated/deleted actor metadata.

Minimum endpoint fields:

  • agent ID;
  • canonical base URL;
  • endpoint classification (internal or external);
  • server-key secret reference;
  • expected TLS/internal-network policy;
  • enabled/verified status;
  • last verification timestamp;
  • no raw credential fields.

API

  • GET/POST /api/v1/hermes/agents
  • GET/PATCH/DELETE /api/v1/hermes/agents/{agentId}
  • restore/purge operations following existing soft-delete conventions;
  • paginated search/filter by name, profile key, environment, lifecycle, and health placeholder.

Permissions

Seed granular permissions for dashboard, agents, health, channels, identities, runs, bindings, approvals, usage, incidents, and audit. Only registry permissions need active endpoints in this issue; later permissions are declared for the epic and documented.

Security requirements

  • Tenant context + ABAC + PostgreSQL RLS on every tenant-owned query.
  • Default deny and deny-overrides-allow.
  • Secret-shaped settings/values rejected.
  • Endpoint URLs validated structurally but not contacted in this issue.
  • High-risk mutation uses Idempotency-Key.
  • Safe audit diff contains field names/status only, never endpoint credentials.
  • Core profile/config records use soft delete; purge is separately authorized and audited.

Acceptance criteria

  • Module is registered through the existing descriptor registry.
  • Full-online feature gate defaults off.
  • Sequential migration creates tables, keys, indexes, FORCE RLS, policies, grants, and permission seeds.
  • Cross-tenant reads/writes fail in integration tests.
  • CRUD, restore, and purge follow current response/error conventions.
  • Raw secrets cannot be accepted or returned.
  • Module management can list and health-classify the registered module.
  • OpenAPI and module README are updated.
  • Unit, API, migration, RLS, ABAC, audit, and soft-delete tests pass.
  • A changeset is added.
  • bun run check passes.

Out of scope

  • Calling Hermes.
  • Provider/model live verification.
  • Telegram configuration.
  • Runs, dashboard, usage, or container lifecycle.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions