AgentStack
SKILL verified MIT Self-run

Br Audit Enrichment

skill-lonsdale201-wp-agent-skills-br-audit-enrichment · by Lonsdale201

Enrich better-route 0.5.0 audit events with safe operational metadata. Use when adding AuditEnricherMiddleware, AuditMiddleware context fields, auth user/provider metadata, hashed Idempotency-Key logging, resource/action audit fields, or reviewing sensitive REST write routes that need traceable but redacted audit events.

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-lonsdale201-wp-agent-skills-br-audit-enrichment

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Br Audit Enrichment? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

better-route: Audit enrichment

Use audit enrichment when the standard route/method/status/duration event is not enough to debug or review sensitive operations.

Pattern

use BetterRoute\Middleware\Audit\AuditEnricherMiddleware;
use BetterRoute\Middleware\Audit\AuditMiddleware;

$router->middleware([
    $jwt,
    new AuditEnricherMiddleware([
        'resource' => 'account',
        'action' => 'update',
    ]),
    new AuditMiddleware($logger),
]);

AuditEnricherMiddleware writes safe fields to RequestContext::$attributes['audit']. AuditMiddleware merges that array into success/error events.

Fields

The enricher can add:

  • authProvider
  • authUserId
  • authSubject
  • idempotencyKey as sha1(raw-key), not the raw header
  • optional clientIp
  • static fields passed by the route, group, or integration

Rules

  • Run auth before audit enrichment if auth fields are needed.
  • Hash idempotency keys; do not log raw keys.
  • Keep payment tokens, card data, secrets, cookies, bearer tokens, and full request bodies out of audit events.
  • Add stable domain fields such as resource, action, and public-safe resource IDs.
  • Use a private logger destination. Client error responses stay scrubbed; audit logs can be more useful but still need redaction.

Source refs

  • libraries/better-route/src/Middleware/Audit/AuditEnricherMiddleware.php
  • libraries/better-route/src/Middleware/Audit/AuditMiddleware.php
  • libraries/better-route/src/Observability/AuditEventFactory.php
  • libraries/better-route/tests/BuiltInMiddlewareTest.php

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.