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) -> strRender a redacted capture event that never exceeds max_bytes.
parameventstrparamsequenceintparampayloadMapping[str, Any]parammax_bytesintparamschemastr | None= NoneReturns
strfuncsanitize_capture_value(value) -> AnyRecursively replace values belonging to credential-like keys.
paramvalueAnyReturns
typing.Anyfunc_sanitize_capture_string(value) -> strparamvaluestrReturns
strfunc_capture_key(value) -> strparamvalueAnyReturns
strfuncredact_known_secrets(value) -> strRedact credential-like environment values and Codex auth values.
paramvaluestrReturns
strfuncis_sensitive_key(key) -> boolReturn whether a key name conventionally contains secret material.
paramkeystrReturns
boolfunc_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_pathstrparamfingerprinttuple[int, int, int, int, int]Returns
frozenset[str]func_sensitive_values(value, *, sensitive=False) -> set[str]paramvalueAnyparamsensitivebool= FalseReturns
set[str]
