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

python
def enable_audit_log(log_path: Optional[str], include_output: bool) -> str

Parameters

ParamField Optional[str]

Path to the audit log file. Defaults to ~/.praisonai/audit.jsonl.

ParamField bool

Whether to include tool output in log entries.

Returns

ResponseField str

Hook ID string.

Usage

python
>>> from praisonai.security import enable_audit_log
    >>> enable_audit_log()

Uses

  • AuditLogHook
  • add_hook
  • audit.create_after_tool_hook

Used By

Source

View on GitHub

praisonai/security/__init__.py at line 139