logging-monitoring

logging-monitoring is a skill for Claude Code from latestaiagents/agent-skills. It costs 62 tokens per session (2,773 once invoked), scanned A, original, MIT.

A guide to recording and watching security-relevant events in an application. It covers audit logs, alerts, and incident detection while identifying information that should never be logged.

In plain words
What is it for?
Use it when adding audit trails, security alerts, breach detection, log analysis, or compliance-related monitoring.
Why use it?
It helps teams notice suspicious activity and investigate incidents without exposing passwords, tokens, payment cards, or other secrets in logs.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the owasp-guardian plugin — 6 skills shipped together , and of security, latestaiagents

Good fit Use it when adding audit trails, security alerts, breach detection, log analysis, or compliance-related monitoring.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/latestaiagents/agent-skills/logging-monitoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add latestaiagents/agent-skills --skill logging-monitoring
Clone the repo
git clone --depth 1 https://github.com/latestaiagents/agent-skills

Made for: Claude Code.

Or install owasp-guardian, the plugin that ships this one along with the rest of its 6 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for logging-monitoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/latestaiagents/agent-skills/logging-monitoring/github.svg)](https://agentmods.dev/skills/latestaiagents/agent-skills/logging-monitoring)
Your own site
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/logging-monitoring"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/logging-monitoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for logging-monitoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/logging-monitoring"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/logging-monitoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,773 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.02773
Opus 5 $0.00031 $0.01386
Sonnet 5 $0.00012 $0.00555
Haiku 4.5 $0.00006 $0.00277

Measured 8d ago against content hash ba7dc0044c66, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

logging-monitoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/security/owasp-guardian/logging-monitoring/SKILL.md · 438 lines

How it starts

The opening of the file, as written. The whole thing — 438 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Security Logging & Monitoring (OWASP A10)

Implement comprehensive logging and monitoring to detect and respond to security incidents.

When to Use

  • Setting up application logging
  • Implementing audit trails
  • Configuring security alerting
  • Building incident detection
  • Compliance requirements (SOC2, GDPR)
  • Post-incident forensics

Critical Events to Log

Event Category Examples Priority
Authentication Login success/failure, logout, MFA events HIGH
Authorization Access denied, privilege changes HIGH
Data Access Sensitive data reads, exports HIGH
Data Modification Create, update, delete operations MEDIUM
Security Events Input validation failures, rate limits HIGH
System Events Startup, shutdown, errors MEDIUM
Admin Actions Config changes, user management HIGH

What NOT to Log

// NEVER log these:
const NEVER_LOG = [
  'passwords',
  'credit_card_numbers',
  'ssn',
  'api_keys',
  'tokens',
  'session_ids',
  'private_keys',
  'health_information'
];

Secure Logging Implementation

1. Structured Security Logger

const winston = require('winston');

// Security event types
const SecurityEventType = {
  AUTH_SUCCESS: 'AUTH_SUCCESS',
  AUTH_FAILURE: 'AUTH_FAILURE',
  AUTH_LOGOUT: 'AUTH_LOGOUT',
  ACCESS_DENIED: 'ACCESS_DENIED',
  PRIVILEGE_ESCALATION: 'PRIVILEGE_ESCALATION',
  DATA_ACCESS: 'DATA_ACCESS',
  DATA_EXPORT: 'DATA_EXPORT',
  INPUT_VALIDATION_FAILURE: 'INPUT_VALIDATION_FAILURE',
  RATE_LIMIT_EXCEEDED: 'RATE_LIMIT_EXCEEDED',
  SUSPICIOUS_ACTIVITY: 'SUSPICIOUS_ACTIVITY',
  ADMIN_ACTION: 'ADMIN_ACTION',
  CONFIG_CHANGE: 'CONFIG_CHANGE'
};

// Security logger configuration
const securityLogger = winston.createLogger({
  level: 'info',
  format: winston.format.combine(
    winston.format.timestamp({ format: 'ISO' }),
    winston.format.json()
  ),
  defaultMeta: {
    service: 'my-app',
    environment: process.env.NODE_ENV
  },
  transports: [
    // Security events to dedicated file
    new winston.transports.File({
      filename: 'logs/security.log',
      level: 'info'
    }),
    // Critical events to separate file
    new winston.transports.File({
      filename: 'logs/security-critical.log',
      level: 'warn'
    }),
    // Send to SIEM (example: Splunk HEC)
    new winston.transports.Http({
      host: 'splunk.example.com',
      port: 8088,
      path: '/services/collector',
      ssl: true
    })
  ]
});

// Log security event function
function logSecurityEvent(eventType, details) {
  const event = {
    eventType,
    timestamp: new Date().toISOString(),
    ...sanitizeForLogging(details)
  };

  // Determine log level based on event type
  const criticalEvents = [
    SecurityEventType.AUTH_FAILURE,
    SecurityEventType.ACCESS_DENIED,
    SecurityEventType.PRIVILEGE_ESCALATION,
    SecurityEventType.SUSPICIOUS_ACTIVITY
  ];

  if (criticalEvents.includes(eventType)) {
    securityLogger.warn(event);
  } else {
    securityLogger.info(event);
  }

  return event;
}

Read the full file on GitHub · 438 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 438 lines · 62 tokens per session scan A ba7dc0044c66

Subscribe to this mod's changes

logging-monitoring is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 62 tokens to every session and 2,773 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.