Skip to content

FR-002: Escalation Routing to Named Owner

Status: Proposed
Priority: High (NexTern compliance requirement)
Author: Tim McCrimmon
Created: 2026-06-10
Target Version: v0.4
Regulatory hook: EU AI Act Art. 14 (human oversight); EU 2026/977 NB accountability posture


Summary

SCP currently captures escalation as a first-class audit outcome — the escalated value is valid in agent_output_logs.outcome and the metadata JSONB field can carry escalation context. But routing that escalation to a specific person is left entirely to the consuming system. There is no structural link between an escalation event and the agent's designated owner.

This FR makes that link explicit and enforceable: when an agent escalates, SCP routes the event to the named owner on record.


Problem Statement

The current escalation model:

Agent escalates → audit log records outcome="escalated" → metadata may or may not contain a target → consumer does whatever it wants

There is no guarantee the right person is notified. There is no audit record of whether the escalation was received or acted on. For a regulated customer asserting EU AI Act Art. 14 compliance, "escalation was logged" is not sufficient — "the accountable person was notified and had the opportunity to act" is what the standard requires.


Proposed Solution

1. Owner field on agent registration

Agent registration already records created_by. Extend the agents table with an explicit owner_id field — a user or role designator that can differ from creator, and can be updated without triggering a full ownership transfer (see FR-004 for formal transfer).

2. Escalation routing on outcome write

When an output log is written with outcome = 'escalated', the API should: - Resolve the agent's current owner_id - Emit a routed escalation event (webhook, internal queue, or notification record) addressed to that owner - Write the routing decision (owner notified, timestamp, delivery mechanism) to the output log metadata or a linked escalation_routing record

3. Escalation routing audit record

Add an escalation_routes table (or extend agent_output_logs metadata schema) to record: - output_log_id — the escalation event that triggered routing - routed_to — owner_id at time of routing - routed_at — timestamp - delivery_status — pending / delivered / failed - acknowledged_at — populated when owner acknowledges (see FR-003)

4. API surface

  • GET /api/agents/{id}/escalations — list open escalation events for an agent
  • POST /api/escalations/{id}/acknowledge — owner acknowledges receipt (foundation for FR-003)

What This Is Not

This FR does not implement acknowledgment checkpoints (FR-003) or formal ownership transfer (FR-004). It establishes the structural link between escalation events and the named owner, and the routing mechanism. Acknowledgment and transfer build on top of this.


Acceptance Criteria

  • Agent registration accepts and stores an owner_id field
  • Writing outcome = 'escalated' to an agent's output log triggers routing to that agent's owner
  • The routing event is recorded with owner, timestamp, and delivery status
  • GET /api/agents/{id}/escalations returns open escalation events with routing status
  • Existing escalation tests updated; new routing tests added