- assigned_to: MoneyMan421
Originally created by: Copilot
This PR addresses the remaining review-thread feedback on app/main.py, app/policy/gate.py, and app/observability/audit.py. The changes remove sensitive-data exposure paths in audit logs and align policy/check behavior with actual runtime behavior.
handle_input() now runs precheck before run_started logging.Replaced raw input logging with safe metadata (classification, input_length).
Output logging hardening
run_completed no longer logs full output payload.Completion audit event now emits only safe metadata (output_length).
Postcheck policy enforcement
postcheck() now performs a minimal sensitive-content check and redacts sensitive output as "[REDACTED]".Updated function intent to match behavior.
Audit logging correctness
audit.py (no global logging side effects on import).Switched audit event emission from Python dict repr to JSON serialization for consistent machine parsing.
:::python
result = precheck_with_warning(user_input)
log_event(run_id, "run_started", {
"classification": result["classification"],
"input_length": len(str(result["input"])),
})
checked_output = postcheck(output)
log_event(run_id, "run_completed", {"output_length": len(str(checked_output))})
Log in to post a comment.