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
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.

Content

Scanner excerpt · SKILL.md (reported line 139)May include surrounding context.

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

Agent Config Directory Access

High
Category
Agent Snooping
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.

Content

Scanner excerpt · SKILL.md (reported line 142)May include surrounding context.

tail -20 ~/.claude/leyline/usage/my-service.jsonl | jq .

Query by date

grep "2025-12-05" ~/.claude/leyline/usage/my-service.jsonl

text
**Verification:** Run the command with `--help` flag to verify availability.

Vague Triggers

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.