UAT: resource_modified audit event never emitted — tool execution framework does not emit RESOURCE_MODIFIED events, leaving file writes unaudited #6658

Open
opened 2026-04-09 22:51:41 +00:00 by HAL9000 · 1 comment
Owner

Summary

The spec requires that all resource modifications are logged in the audit trail. The AuditEventSubscriber is registered to handle RESOURCE_MODIFIED events, but the tool execution framework never emits this event. As a result, file writes performed by plan execution are never recorded in the audit log.

Spec Reference

From the Security & Safety specification:

Audit logging — all actions logged with timestamps and user context

The VALID_EVENT_TYPES in audit_service.py includes "resource_modified", and the spec (§Audit Logging SEC7) requires this event to be recorded when resources are modified.

Expected Behavior

When a plan execution modifies a file (via the sandbox), a resource_modified audit event should be emitted with:

  • plan_id: the plan that caused the modification
  • project_name: the project being modified
  • actor_name: the actor that performed the modification
  • details: the file path(s) modified

Actual Behavior

The AuditEventSubscriber code explicitly notes this gap:

# NOTE: RESOURCE_MODIFIED has no producing service yet — the tool
# execution framework does not emit this event.  The subscriber handler
# is intentionally registered so that audit entries are automatically
# created once tool-write event emission is implemented.
EventType.RESOURCE_MODIFIED: "resource_modified",

No code in the tool execution pipeline emits EventType.RESOURCE_MODIFIED. Searching the codebase confirms there are no callers that emit this event type.

Code Locations

  • src/cleveragents/application/services/audit_event_subscriber.py — subscriber registered but event never emitted
  • src/cleveragents/infrastructure/sandbox/copy_on_write.pycommit() applies file changes but does not emit RESOURCE_MODIFIED
  • src/cleveragents/infrastructure/sandbox/git_worktree.pycommit() applies git changes but does not emit RESOURCE_MODIFIED

Impact

Security auditors cannot determine which files were modified during plan execution from the audit log alone. This is a compliance gap for the spec-required audit trail.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary The spec requires that all resource modifications are logged in the audit trail. The `AuditEventSubscriber` is registered to handle `RESOURCE_MODIFIED` events, but the tool execution framework never emits this event. As a result, file writes performed by plan execution are never recorded in the audit log. ## Spec Reference From the Security & Safety specification: > **Audit logging** — all actions logged with timestamps and user context The `VALID_EVENT_TYPES` in `audit_service.py` includes `"resource_modified"`, and the spec (§Audit Logging SEC7) requires this event to be recorded when resources are modified. ## Expected Behavior When a plan execution modifies a file (via the sandbox), a `resource_modified` audit event should be emitted with: - `plan_id`: the plan that caused the modification - `project_name`: the project being modified - `actor_name`: the actor that performed the modification - `details`: the file path(s) modified ## Actual Behavior The `AuditEventSubscriber` code explicitly notes this gap: ```python # NOTE: RESOURCE_MODIFIED has no producing service yet — the tool # execution framework does not emit this event. The subscriber handler # is intentionally registered so that audit entries are automatically # created once tool-write event emission is implemented. EventType.RESOURCE_MODIFIED: "resource_modified", ``` No code in the tool execution pipeline emits `EventType.RESOURCE_MODIFIED`. Searching the codebase confirms there are no callers that emit this event type. ## Code Locations - `src/cleveragents/application/services/audit_event_subscriber.py` — subscriber registered but event never emitted - `src/cleveragents/infrastructure/sandbox/copy_on_write.py` — `commit()` applies file changes but does not emit `RESOURCE_MODIFIED` - `src/cleveragents/infrastructure/sandbox/git_worktree.py` — `commit()` applies git changes but does not emit `RESOURCE_MODIFIED` ## Impact Security auditors cannot determine which files were modified during plan execution from the audit log alone. This is a compliance gap for the spec-required audit trail. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 23:04:01 +00:00
Author
Owner

Verified — UAT bug: resource_modified audit event never emitted — file writes unaudited. MoSCoW: Should-have. Priority: High.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — UAT bug: resource_modified audit event never emitted — file writes unaudited. MoSCoW: Should-have. Priority: High. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#6658
No description provided.