sensitive-logging-audit

Audit and fix model and tool payload exposure in openai-agents-js runtime logging.

3.7k|945|Updated May 31, 2025
One-click install
npx skills add https://github.com/openai/openai-agents-js --skill sensitive-logging-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sensitive-logging-audit
Source: https://github.com/openai/openai-agents-js/tree/main/.agents/skills/sensitive-logging-audit
Command: npx skills add https://github.com/openai/openai-agents-js --skill sensitive-logging-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typescript, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Runtime logging in the openai-agents-js SDK can accidentally leak model inputs/outputs, tool arguments and results, Realtime events, MCP payloads, session history, or arbitrary thrown error values, even when the OPENAI_AGENTS_DONT_LOG_MODEL_DATA or OPENAI_AGENTS_DONT_LOG_TOOL_DATA flags are enabled. This Skill inventories every logger and console call, classifies each dynamic value against the documented flag contract, and fixes only demonstrated leaks without over-redacting operational metadata like names, IDs, counts, and statuses.

Core Features & Use Cases

  • Deterministic log sink inventory: A TypeScript AST-based script inventories every logger and console call, resolves aliases, destructured methods, computed methods, and Logger-typed members, and emits stable fingerprints plus JSON or summary reports.
  • Evidence-gated leak classification: Each dynamic sink is classified as model, tool, model+tool, operational, or uncertain, requiring source-to-sink tracing and a sentinel reproducer before any runtime code is changed.
  • Policy-aware remediation and regression tests: Fixes route through helpers like logModelActionError and logToolActionError, with an adversarial validation matrix covering redacted and diagnostic modes, hostile constructors, revoked Proxies, and supplemental payloads.
  • Use Case: While reviewing a pull request that adds error logging to tool execution, run the inventory to confirm whether a caught exception can carry tool arguments past the dontLogToolData flag, then apply the narrowest shared-boundary fix and re-audit.

Quick Start

Ask the agent to audit the repository's runtime logging for model or tool payload leaks using the sensitive-logging-audit workflow and report any confirmed exposures.

Frequently Asked Questions about sensitive-logging-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit logging for sensitive data leaks in openai-agents-js?

Run the inventory script with node .agents/skills/sensitive-logging-audit/scripts/inventory-logging.mjs --format json from the repository root. Review every dynamic sink in the JSON ledger, classify each value against the model/tool flag contract, and fix only leaks proven by source-to-sink tracing and a sentinel reproducer.

What do OPENAI_AGENTS_DONT_LOG_MODEL_DATA and OPENAI_AGENTS_DONT_LOG_TOOL_DATA suppress?

dontLogModelData suppresses LLM inputs and outputs, while dontLogToolData suppresses tool inputs and outputs. They do not hide operational metadata such as agent names, tool names, session IDs, trace IDs, counts, durations, or status codes.

Does the inventory script prove a logging vulnerability automatically?

No. The inventory proves sink coverage and provides lexical review hints, but it does not perform taint analysis. Confirming a leak requires tracing the exact value to the sink, showing the flag can be enabled while the value is logged, and reproducing exposure with a sentinel.

Why are raw console calls prioritized over logger calls in the audit?

Raw console.* calls bypass the Logger policy entirely, so the dontLogModelData and dontLogToolData flags cannot suppress them. Calls logging caught values are next in priority because arbitrary thrown values can retain user data.

What regression tests are required after fixing a logging leak?

Test redacted and diagnostic modes, model-only, tool-only, and both-flag combinations, with unique sentinels in real payload or error fields. Include hostile cases like throwing constructors, revoked Proxies, and supplemental payloads, and verify caller behavior such as fallbacks and cleanup still completes.