Skip to content

Trace export

The runner records behaviours and their policy outcomes as a task trace. KV_LOG_LOCATION selects the destination; KV_LOG_FORMAT selects its format. See Engine settings for the settings and defaults, and tasks and history for lifecycle rules.

Destinations and formats

Location Format Output
Platform URL kv Task batches sent to /api/v1/logs/batch
Collector URL otlp OpenTelemetry spans sent over HTTP
stdout Any Task JSON printed to the terminal
File path json One JSON record per line
none or empty Any Disabled

auto follows the policy source: platform policies send traces to the platform; an offline policy source prints them to stdout. Set the location explicitly to select another destination. Incident destinations and formats can be configured separately; when unset, they inherit the trace settings.

Each current JSONL record is a step with kind, agent_id, and task_id. Consumers must ignore record types they do not understand, including a record without kind, so new record types can be added. The stdout exporter's steps entries follow the same rule. Output is strict JSON, excluding NaN and Infinity.

Policy outcomes and payload redaction

A recorded step carries a preceding evaluation's outcome in meta["kyvvu.eval"]: the action, risk score, and the evaluated policies with their rule types, severities, and violation status.

log_payloads controls exported input/output and violation details. In full mode those details can include payload values. metadata_only replaces detail values with redaction markers; sha256 adds the canonical value's byte length and SHA-256 digest. Digests use RFC 8785 canonical JSON. Keys identifying the rule and field remain readable: field, kind, verb, rule_type, label, passed, reason, and the nested sub_results structure.

Manifest provenance

Each policy outcome includes manifest_id when that policy came from a manifest assignment. Hand-authored policies omit it. The task.start record's meta["kyvvu.manifests"] contains the distinct manifests in effect when the task started, including names and the repository, path, SHA, assignment time, and assigning user when supplied by the platform.

The task-start list is a snapshot. Policies can refresh during a task; each step's evaluation records the policies that decided that step. The runner also supplies the in-effect manifests through EvalContext.manifests.

OpenTelemetry spans

A task becomes a root span named kyvvu.task plus the first twelve characters of its task ID. Each step.* becomes a child span named for its kind; task boundaries do not become child spans. Timing reflects recording rather than measured execution duration.

Span attributes include aag.agent_id, aag.task_id, aag.action_id, aag.seq, aag.kind, aag.verb, aag.step_name, and flattened aag.properties.*. Policy attributes include aag.policy.decision, kyvvu.eval.risk_score, aag.policy.rules, aag.policy.violations, and aag.policy.severity. kyvvu.policy.rule_manifests and kyvvu.policy.violation_manifests identify each policy's source manifest, using an empty string for a policy without one.

Delivery and integrity

HTTP exports use a bounded background queue. Flush before a short process exits when delivery matters; inspect report status for dropped reports. See the data flow for queue, overflow, and exit behaviour, and the REST guide for batch acknowledgements and the hash chain's coverage and limits.