navi-go

4. Explainable & Responsible AI Practices

This document summarizes NaviGo’s explainability and responsible AI practices based on the current repository implementation (src/**, tests/**, .github/workflows/**, scripts/**).

4.1 Explainability Design

1) Decision Log

Every agent appends a decisionLog entry (makeDecisionLog) when outputting Partial<PlannerState>, including:

This means callers can see not only the final finalPlan, but also “what decision was made based on what evidence” at every step.

2) Structured Output Constraints

All LLM-requiring agents use withStructuredOutput(...) + Zod schema, preventing free text from directly entering state:

3) Unified Boundary Validation

Zod validation covers:

4.2 Responsible AI Implementation

1) User Intent Priority

2) Explicit Risk Exposure, No Silent Handling

Even if planning can continue, risks are never hidden.

3) Controlled Refusal Path

When prompt injection (BLOCKED_PROMPT_INJECTION) is detected, the router sends flow directly to plan_synthesizer to generate a safe refusal summary, rather than continuing the full planning chain.

4) Natural-Language Interaction Transparency

form_completer does not silently guess or fill in missing required fields; instead, it generates 1–2 natural-language clarifying questions returned to the client, and only continues after user confirmation. This prevents the model from擅自 inferring user constraints that were not explicitly expressed.

4.3 Traceability and Audit

1) Thread-Level State Replay

Graph state is persisted via checkpointer; the API provides GET /plan/:threadId to read thread snapshots for:

2) Optional LangSmith Tracing

Enabled when LANGSMITH_TRACING=true; metadata is injected via buildTraceMetadata(...) with:

4.4 Data Processing and Minimization (Current Status)

In the current implementation, userRequest (including userId) is part of PlannerState, so it enters checkpoint state (depending on the checkpointer used).

Therefore:

If the deployment has stricter data minimization requirements, it is recommended to anonymize/map userId before invocation, or introduce a minimal-field policy at the state layer.

4.5 Verified Advantages and Boundaries

Advantages Already Achieved

Known Boundaries

All above boundaries can be directly observed from the existing codebase.