Powercontextclient

capture

Safe, bounded rendering helpers for agent trajectory capture.

attributeSENSITIVE_KEY_PARTS
= ('api_key', 'authorization', 'cookie', 'password', 'secret', 'token')
attributeSENSITIVE_KEY_COMPACT_PARTS
= tuple((part.replace('_', '')) for part in SENSITIVE_KEY_PARTS)
attributeREDACTED
= '[REDACTED]'
attributeUNSERIALIZABLE
= '[UNSERIALIZABLE]'
funcrender_capture_event(event, sequence, payload, max_bytes, *, schema=None) -> str

Render a redacted capture event that never exceeds max_bytes.

parameventstr
paramsequenceint
parampayloadMapping[str, Any]
parammax_bytesint
paramschemastr | None
= None

Returns

str
funcsanitize_capture_value(value) -> Any

Recursively replace values belonging to credential-like keys.

paramvalueAny

Returns

typing.Any
func_sanitize_capture_string(value) -> str
paramvaluestr

Returns

str
func_capture_key(value) -> str
paramvalueAny

Returns

str
funcredact_known_secrets(value) -> str

Redact credential-like environment values and Codex auth values.

paramvaluestr

Returns

str
funcis_sensitive_key(key) -> bool

Return whether a key name conventionally contains secret material.

paramkeystr

Returns

bool
func_codex_auth_secrets() -> frozenset[str]

Returns

frozenset[str]
func_cached_codex_auth_secrets(auth_path, fingerprint) -> frozenset[str]

Read Codex credentials once for each observed auth-file version.

paramauth_pathstr
paramfingerprinttuple[int, int, int, int, int]

Returns

frozenset[str]
func_sensitive_values(value, *, sensitive=False) -> set[str]
paramvalueAny
paramsensitivebool
= False

Returns

set[str]