Enable Audit Log • AI Agents Framework
enable_audit_log: Enable an append-only JSONL audit log for all agent tool calls.
enable_audit_log
Function
</div>
This function is defined in the security module.
Enable an append-only JSONL audit log for all agent tool calls.
.. warning:: Registers on the process-global `praisonaiagents.hooks registry; the audit sink applies to every Agent in the process. Keep the returned hook ID and remove it via praisonaiagents.hooks.remove_hook` to scope or disable it later.
Signature
def enable_audit_log(log_path: Optional[str], include_output: bool) -> strParameters
ParamField
Optional[str]Path to the audit log file. Defaults to ~/.praisonai/audit.jsonl.
ParamField
boolWhether to include tool output in log entries.
Returns
ResponseField
strHook ID string.
Usage
>>> from praisonai.security import enable_audit_log
>>> enable_audit_log()Uses
AuditLogHookadd_hookaudit.create_after_tool_hook
Used By
Source
View on GitHubpraisonai/security/__init__.py at line 139