codex-log-guard

codex-log-guard is a skill for Codex from majiayu000/spellbook. It costs 68 tokens per session (2,236 once invoked), scanned A, original, MIT.

A read-only diagnostic tool for Codex's local SQLite files, including logs2.sqlite and its write-ahead log. It checks how diagnostic logging is behaving and selects a safe response mode.

In plain words
What is it for?
Use it to inspect logging, protect against further writes, clean up logs when explicitly requested, or restore logging after protection.
Why use it?
It helps investigate excessive log writes, possible SSD wear, or disk usage without changing data by default.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions Codex; $skill-name invocation.

Good fit Use it to inspect logging, protect against further writes, clean up logs when explicitly requested, or restore logging after protection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/spellbook/codex-log-guard
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 majiayu000/spellbook --skill codex-log-guard
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

Made for: Codex.

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 codex-log-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/codex-log-guard/github.svg)](https://agentmods.dev/skills/majiayu000/spellbook/codex-log-guard)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/codex-log-guard"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/codex-log-guard/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 codex-log-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/codex-log-guard"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/codex-log-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,236 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Rogue Agent · line 38
    Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
    Fix: Prevent the skill from modifying its own code, SKILL.md, or configuration files. Treat skill files as read-only at runtime.
  • medium Rogue Agent · line 21
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Excessive Agency · line 59
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Rogue Agent · line 143
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00068 $0.02236
Opus 5 $0.00034 $0.01118
Sonnet 5 $0.00014 $0.00447
Haiku 4.5 $0.00007 $0.00224

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

Security

Grade A, and why

codex-log-guard 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 9d 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/codex-log-guard/SKILL.md · 200 lines

How it starts

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

Codex Log Guard

Overview

Diagnose Codex persistent diagnostic logging from local evidence, then give a concise conclusion and the safest next action. Do not make the user choose from a command menu.

Operating Contract

Select one mode from the current user request:

  • diagnose_only is the default for check, inspect, explain, or verify requests. It is read-only.
  • protect requires an explicit request to stop or mitigate log writes. It may install and verify block_log_inserts, but it does not delete rows or vacuum files.
  • cleanup requires an explicit current request to reclaim disk space or clean up logs. It first installs protection when needed, creates and verifies a timestamped backup, and only then deletes log rows and vacuums.
  • restore requires an explicit request to resume diagnostic logging. It may drop only the known block_log_inserts trigger.

Generic wording such as "处理", "修一下", or "止血" selects protect, not cleanup. Prior approval does not carry into a later run. If the requested write mode is ambiguous, return the diagnose_only report and the exact proposed mutation without applying it.

Direct actions:

  • Run local read-only file, SQLite schema, row, and open-process checks.
  • Apply only the mutation authorized by the selected mode and verify its result.

Escalate before:

  • Touching any database outside the two declared Codex log paths, deleting a backup, killing a process, or changing remote telemetry or credentials.

Evidence-backed pushback:

  • Reject cleanup when protection is unverified, the backup check failed, or sampled row IDs still move. Cite the exact database path and failed command instead of treating file size as proof.

Feedback loop:

  • When a new schema, active path, or false-success signal is confirmed more than once, update this Skill's diagnosis rules and a focused contract test before automating that case.

agents/openai.yaml contains discovery UI metadata only; it is not an operational instruction source.

Read the full file on GitHub · 200 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 200 lines · 68 tokens per session scan A 4ddc42a07fc9

Subscribe to this mod's changes

codex-log-guard is a skill published in the GitHub repository majiayu000/spellbook (277 stars, last pushed today), licensed MIT. It adds 68 tokens to every session and 2,236 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-08-30.