Agent Governance Toolkitagent-governance-toolkit 4.1.0 · Python 3.10+
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
23 small wins to finish your pathNext lesson

Where the audit trail went

The kernel has a method called get_audit_log. After nineteen lessons of allowed and refused calls it returns an empty list, and this lesson is about why.

Run a few calls through the gate and then ask the kernel what it recorded.

Example
from agent_control_plane import AgentKernel, PolicyEngine

policy = PolicyEngine()
policy.add_constraint("support", ["lookup_order"])
kernel = AgentKernel(policy_engine=policy)

kernel.intercept_tool_execution("support", "lookup_order", {"order_id": "A17"})
kernel.intercept_tool_execution("support", "delete_order", {})
print("entries:", len(kernel.get_audit_log()))

Two decisions, one of them a refusal, and nothing was written down. The list is real and the method works; interception simply does not put anything in it.

What does fill it

The in-memory list is written to by the kernel's own bookkeeping, like opening a session, rather than by the gate.

Example
kernel.create_agent_session("support")
for entry in kernel.get_audit_log():
    print(entry["event_type"], sorted(entry["details"]))

So the method is not broken and the list is not unused. It is simply not where tool-call decisions go.

This is the third time in this course that a piece of the library has quietly done nothing: the quota ignored on the interception path in lesson 7, the custom rule in lesson 8, and now the audit log. The pattern is worth naming. This library is several components behind one import, and a method existing on an object is not evidence that the path you are on uses it.

Where they actually go

Tool-call decisions go to an audit logger passed in when the kernel is built. Without one, the kernel checks the policy, returns a verdict and forgets.

Example
kernel = AgentKernel(policy_engine=policy)
print("audit_logger:", kernel.audit_logger)

None, because nothing was passed. Every if self.audit_logger inside the gate is therefore false, and every recording step is skipped without complaint.

Lesson 20 builds the thing that goes in that slot. It is worth the lesson: a governance layer that cannot say what it did is a governance layer nobody can be asked to trust.

Try it yourself
  • Call create_agent_session twice and watch the list grow.
  • Add a policy rule with add_policy_rule and check whether that is recorded.
  • Read kernel.audit_log directly and confirm it is the same list the method copies.

This is what real progress feels like.