Install
$ agentstack add skill-lonsdale201-wp-agent-skills-br-audit-enrichment ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
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:
authProviderauthUserIdauthSubjectidempotencyKeyassha1(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.phplibraries/better-route/src/Middleware/Audit/AuditMiddleware.phplibraries/better-route/src/Observability/AuditEventFactory.phplibraries/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.
- Author: Lonsdale201
- Source: Lonsdale201/wp-agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.