Skip to content

feat: interaction log for run/node prompts + outputs (follow-up to #722) #785

Description

@rafeekpro

Summary

Extend the EU AI Act interaction log (#722, PR #784) to the bigger compliance surface: agent/node prompts and outputs from pipeline runs.

The mechanism already exists and should be reused as-is:

  • dap_engine.redaction.redact() — exact-value scrub (decrypted instance env vars) + pattern scrub
  • persistence/interaction_log.record_interaction(surface="run"|"node", ...) — the table, admin API (GET /interactions?surface=...), retention purge and config all already handle non-assistant surfaces

Scope

  • Record a redacted interaction per node execution that calls a model: the rendered prompt (redacted_request) and the raw model output (redacted_response), with provider/model/tokens_used from the adapter result
  • Decide the integration point: execution/node_executor.py (has the prompt + output + adapter metadata) vs. the adapter base (closer to the wire, catches CLI runtimes too)
  • known_secrets resolution inside the run context — runs resolve instance env vars already; thread the decrypted mapping to the redaction call
  • Volume control: node outputs can be large (node_output_chunks exists for streaming) — decide truncation policy for the interaction record (e.g. cap at N KB with an explicit [TRUNCATED] marker in extra)
  • Tests: redaction of secrets embedded in prompts and in model outputs; volume cap; per-surface filtering in the admin API

Non-goals

Mechanism from #722; this issue is the "Follow-up: agent/node prompts + outputs" item from its acceptance criteria.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:engineCode in apps/engine/*area:observabilitynode_execution_logs, batch_runs, audit_log, /healthenhancementNew feature or requestsecurityAnything in the threat model

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions