TheDocumentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
@frontmcp/adapters/skills module provides a tamper-evident, hash-chained audit log for skill action executions. Every authority pass / authority fail / HTTP success / HTTP failure phase emitted by the skill action runner is captured, signed, and chained so any later mutation breaks signature verification.
Why tamper-evident?
Skill action audit trails are often subject to compliance review. A plain log file can be edited; a hash-chained, signed log cannot be modified, reordered, or partially deleted without breaking verification. Pair the log with an out-of-band notarization channel (planned for v1.3.0) and even tail truncation becomes detectable.Architecture
SkillAuditRecord carries:
| Field | Description |
|---|---|
sequence | Strictly increasing position in the chain |
prevHash | SHA-256 hash of the previous record (or null at sequence 0) |
signature | Base64url signature over the canonical record bytes |
signatureKeyId | The signer key identifier — used by verifiers to look up the public key |
signatureAlg | 'HS256' or 'RS256' |
phase | authority_pass, authority_fail, http_ok, http_fail |
skillId | The skill that owns the action |
actionId | The action that was executed |
subject | Authenticated principal — redacted per subjectMode |
bundleVersion | The bundle version active at the time of the call |
Configuring via skillsConfig.audit
Wire the audit subsystem through skillsConfig.audit on @FrontMcp. The SDK does not statically depend on @frontmcp/adapters/skills — call setSkillAuditFactory(...) once at boot to inject the audit module. This keeps the static dependency graph clean and works in Edge / CSP runtimes.
Built-in signers
| Signer | Key | When to use |
|---|---|---|
Hs256AuditSigner | Symmetric HMAC-SHA-256 | Dev / tests only. Refuses to fire when NODE_ENV === 'production' with a random key |
Rs256AuditSigner | Asymmetric RS256 | Production. Reuse the bundle-signing keypair so the same trust root covers both |
Rs256AuditSigner uses rsaSignBase64Url from @frontmcp/utils under the hood.
Built-in stores
| Store | Persistence | When to use |
|---|---|---|
MemoryAuditStore | In-process; lost on restart | Tests, local dev |
StorageAdapterAuditStore | Any @frontmcp/utils storage adapter (Redis, KV, SQLite) | Production |
Custom stores
A custom store implements:Verifying the chain
verifyChain returns { ok: true } | { ok: false; breakAt: number; reason: string }. defaultAuditSignatureVerifier understands HS256 and RS256 records and dispatches based on record.signatureAlg.
DI integration
SkillAuditWriterToken is the DI token for the active writer. Plugins that need to emit additional audit records (e.g., a custom authority gate) can resolve it:
SkillAuditWriterToken rather than rolling their own audit log so the chain stays unified.
Threat model
What the audit log catches:- Record mutation — any byte-level change breaks the signature.
- Record reordering — the
prevHashchain breaks. - Record deletion in the middle —
prevHashmismatch on the next record.
- Tail truncation — if an attacker deletes the tail, no record survives to flag it. Mitigation: anchor the chain head out-of-band (queued for v1.3.0 to be wired into the CAS-based atomic head update).
- Multi-pod races — v1.2.0 is single-writer only. Multiple pods writing to the same store will produce a loud warning and may interleave sequences. CAS-based atomic chain head updates are queued for v1.3.0.
Operational concerns
- Key rotation: signers carry a
keyId; verifiers mapkeyId → public key. Keep historical keys in your verifier’s trust map for as long as you keep the records. - Storage growth: plan for a retention policy. The chain only needs to be intact within the retention window.
- Compliance: RS256 + a persistent store + a CI verifier give you a forensic-grade trail.
Related
@FrontMcp
Configure
skillsConfig.audit on the serverTelemetry API
frontmcp_skills_audit_dropped_total counter and other skill metrics