Back to skill

Security audit

usage-logging

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only usage logging skill that stores local audit/session metadata and shows no hidden execution, exfiltration, or destructive behavior.

Install only if you want persistent local usage and audit logs. Avoid placing secrets or sensitive personal data in log metadata, periodically review or delete files under ~/.claude/leyline/usage, and use shared session IDs only when cross-service activity correlation is appropriate.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Agent Config Directory Access

High
Category
Agent Snooping
Content
```bash
# View recent logs
tail -20 ~/.claude/leyline/usage/my-service.jsonl | jq .

# Query by date
grep "2025-12-05" ~/.claude/leyline/usage/my-service.jsonl
Confidence
85% confidence
Finding
Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Agent Config Directory Access

High
Category
Agent Snooping
Content
tail -20 ~/.claude/leyline/usage/my-service.jsonl | jq .

# Query by date
grep "2025-12-05" ~/.claude/leyline/usage/my-service.jsonl
```
**Verification:** Run the command with `--help` flag to verify availability.
Confidence
85% confidence
Finding
Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Vague Triggers

Medium
Confidence
97% confidence
Finding
The trigger list includes broad generic terms like 'logging', 'usage', 'audit', 'metrics', 'sessions', and 'analytics', which can cause the skill to activate in many unrelated contexts. Over-broad activation increases the chance of unintended invocation of storage-related behavior and can expose users to logging features they did not explicitly request.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The activation phrase 'or cost tracking to a skill' is grammatically incomplete and ambiguous, making invocation behavior unpredictable. Ambiguous routing cues can cause accidental skill selection in contexts where the user did not intend to enable persistent logging or audit-trail functionality.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill describes audit trails and usage logging but does not clearly warn users that data is persisted locally under the agent configuration directory. Because logs may contain operational metadata, session identifiers, timestamps, token counts, and potentially sensitive metadata fields, failing to disclose persistence undermines informed consent and safe handling expectations.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This markdown file includes code that creates and updates a local `session.json` file containing session identifiers and activity timestamps. While the code comments describe the mechanics, the surrounding documentation does not warn users that usage/session metadata will be persisted locally, which is relevant to privacy and data handling.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The document recommends passing a shared `session_id` between services and correlating operations across them, which can increase traceability of user activity across systems. The markdown does not disclose this cross-service linkage or its privacy implications to users.

Static analysis

No suspicious patterns detected.