profile-native-agent-runtimes

/home/avalon/.hermes/skills/autonomous-ai-agents/profile-native-agent-runtimes/SKILL.md · raw

Profile-Native Agent Runtimes

Use this skill when

This skill governs the execution boundary, not the product's domain model. Projects, reviews, jobs, commands, and business records remain owned by the product database; Hermes profiles identify reasoning operators and provenance.

Core invariant

thread or job
  → hermes_profile_id
  → freshly loaded profile row
  → exact opaque runtime_ref
  → trusted tenant API origin/key
  → /p/<profile-slug>/...
  → isolated profile home/session/secrets
  → profile-bound product capability
  → canonical domain command
  → project-owned state + profile provenance

If any arrow cannot be proven, enforcement must fail closed. Never route to a shared/global conductor as a recovery path.

Procedure

  1. Reconstruct authority before editing. Trace profile schema, router, chat transport, job schema/claiming, plugin configuration, capability broker, audit provenance, and tier topology. Distinguish a profile record from a real runtime boundary.
  2. Reuse Hermes's native multiplexer. Prefer one tenant Hermes API with profile-prefixed routes and profile homes over inventing a second supervisor or mutating process-global environment variables.
  3. Define one versioned runtime contract. Planning, materialization, activation, chat, jobs, and appliance configuration must use the same contract and directory layout.
  4. Keep runtime_ref opaque. It is server-issued identity, never a URL/path and never model-supplied authority. Compare it to the freshly loaded profile row on every dispatch boundary.
  5. Materialize private roots. Make the tenant root API-only and suppress broad bundled skills. Make each profile home private and isolate sessions, memory, knowledge, cron, workspace, plugins, config, and secrets.
  6. Bind connectors locally. Profile-local config and scoped secret lookup override hostile ambient values. Do not expose caller-selectable project authority when a business profile already determines the project.
  7. Probe before activation. Through the exact profile prefix, require detailed health plus Caduceus toolset/tool and skill evidence. Activate transactionally only if status and runtime binding are unchanged; persist profile-attributed evidence.
  8. Route the whole chat run. Session creation/resume, messages, history, run polling/events, streaming, and interruption must retain the same resolved runtime descriptor.
  9. Own reasoning jobs by profile. Persist and verify hermes_profile_id plus project_id where applicable. Include profile identity in recurring-job deduplication. Portfolio work uses the portfolio profile; business work uses its owning business profile.
  10. Derive product authority from the profile. Bind keys to hermes_profile_id, reload profile authority per request, require explicit capabilities, treat supplied project IDs only as consistency assertions, and use field-level grants for portfolio reads. Delegate portfolio business mutations to the owning business profile.
  11. Prove isolation before cutover. Run disposable Normal and two-business Pro live HTTP canaries, then adversarial cross-profile resume/targeting, stale binding, revocation, restart, job, and rollback tests.
  12. Integrate parallel work skeptically. Worker completion notices are not evidence. Inspect branches and diffs, rerun focused tests, reconcile duplicate contracts immediately, then run integrated and broad suites.

Security invariants

Verification gates

Pitfalls

Detailed reference

Read references/runtime-contract-pattern.md for concrete validation rules, filesystem/materialization guidance, activation logic, chat/job routing coverage, authorization design, and the complete TDD/canary sequence.