Data and privacy ​
Treat agent logs as potentially sensitive even when optional payload capture is disabled. Tool arguments, error messages, trace metadata, user identifiers, and session identifiers can still contain application data.
Default capture ​
The run-end record always includes the final assistant text. By default, createLoggerObserver() omits the full payloads:
- Typed structured output.
- Full model requests and responses.
- Tool results and structured results.
It still records operational fields such as usage, model identity, timing, tool arguments, and errors.
Application controls ​
- Avoid placing secrets in trace metadata or tool arguments.
- Prefer stable internal identifiers over email addresses or names.
- Redact at the application boundary before values reach the observer.
- Configure destination retention and access controls independently.
- Review error serialization:
name,message,stack, andcauseare logged forErrorinstances.
The four capture flags are coarse switches, not a redaction engine. If selected fields need transformation, wrap the Logger contract or sanitize data before the agent run.
Error stacks ​
Logger observers omit serialized Error.stack by default, including nested Error.cause stacks, to avoid exposing host paths. Set createLoggerObserver({ logger, includeErrorStack: true }) only when the logging policy permits debugging stacks. Provider-output errors retain their dedicated safe handling. Core's default redaction patterns also cover Google API keys, GitHub tokens, AWS access-key IDs, and Slack tokens; pattern redaction does not replace application capture controls.