Title here
Summary here
Date: 2026-02-21 Status: Accepted Issue: F071
Workflow inputs may contain secrets (API keys, passwords, tokens). The audit trail must mask these values before writing. The question is which layer owns the masking responsibility, given hexagonal architecture constraints.
The application layer (ExecutionService) masks inputs before constructing AuditEvent, using an inlined prefix-check function (mirroring SecretMasker.IsSecretKey() logic). The AuditTrailWriter port accepts pre-sanitized AuditEvent structs with no knowledge of secrets.
Alternatives rejected:
HistoryStore pattern: application layer transforms domain data before persistence.Write + Close); infrastructure adapter contains no business logic.SecretMasker. If masking patterns change, both masker.go and execution_service.go must be updated.