> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/platform-api/safety.md).

# Safety & Monitoring

This page covers the safety model, the audit trail, retention, and compliance reporting. The other pages in this section cover the rest of the monitoring and observability surface:

* [Analytics & Observability](/developer-guide/platform-api/safety/analytics.md) - workspace analytics, call intelligence aggregates, recordings, dashboards, the real-time event stream, and private-preview external-write proposal review
* [Insights](/developer-guide/platform-api/safety/insights.md) - read-only SQL, schema discovery, and workspace health digests
* [Metric Store](/developer-guide/platform-api/safety/metric-store.md) - built-in and custom metric definitions, AI evaluation, and metric queries
* [Call Trace Analysis](/developer-guide/platform-api/safety/call-trace-analysis.md) - per-call emotional arcs, key decision moments, and coaching recommendations
* [Voice Judge](/developer-guide/platform-api/safety/voice-judge.md) - audio-native quality scores across ten voice dimensions
* [Production Evals](/developer-guide/platform-api/safety/production-evals.md) - assertion and metric checks against live completed calls
* [Simulation Coverage](/developer-guide/platform-api/safety/simulation-coverage.md) - systematic exploration of context graph state space
* [Prompt Logs](/developer-guide/platform-api/safety/prompt-logs.md) - full LLM inputs and outputs for auditing and debugging
* [Trace Export](/developer-guide/platform-api/safety/trace-export.md) - tool-call trace spans for external observability collectors

## Safety Model

Safety behavior is authored in the agent and its Context Graph through guidance, entry states, exit conditions, eligible tools, and escalation instructions. A model can still miss or misclassify a concern, so teams must test representative cases and preserve a human fallback. Supported workflows can forward a call or let an operator join; there is no separate configuration surface that makes every conversation independently safety-certified.

See [Voice Agent](/developer-guide/platform-api/conversations/voice-agent.md) for the call escalation flow and [Operators](/developer-guide/platform-api/conversations/operators.md) for the operator join flow.

## Audit Trail

The Platform API provides a workspace-scoped audit surface for supported event producers. Covered routes and services record the context available to that producer; the audit API is not proof that every platform action or downstream system mutation was captured.

### PHI Access Logging

Supported PHI-sensitive routes classify their audit events, including selected entity reads, FHIR patient data, call recordings, call intelligence, and audit-report access. Covered events use `phi_accessed: true` for reporting. Validate route coverage against your own audit requirements instead of assuming the PHI report observes every access path.

Audit publication is separate from the primary operation on supported asynchronous paths. An operation can therefore succeed even if its audit write is delayed or fails; monitor audit delivery rather than treating it as transactionally coupled evidence.

### Audit Query Endpoints

All audit query endpoints require `admin` or `owner` permissions and are workspace-scoped.

#### List Audit Events

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/audit" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

#### Get the PHI Access Report

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/audit/phi-access" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

#### Get an Entity Access Log

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/audit/entity/{entity\_id}/access-log" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

#### Get the Audit Summary

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/audit/summary" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Data Lineage

For entity-level provenance and the currently populated lineage fields, see [Entity Intelligence](/developer-guide/platform-api/data-world-model.md#entity-intelligence). Compatibility arrays that are empty do not establish destination-delivery or review history.

## Retention Policies

### Get the Retention Policy

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/settings/retention" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

Returns configured defaults of 2,190 days (6 years) for fields that are not explicitly set. A stored duration is not by itself a compliance determination.

### Update the Retention Policy

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/settings/retention" method="put" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

Updates are partial: omitted fields remain unchanged.

The retention GET endpoint is available to any authenticated user; the PUT endpoint requires `admin` or `owner`. Retention changes are audit-logged.

{% hint style="info" %}
Retention policies are currently advisory: the policy is stored and displayed but automated deletion is not yet enforced.
{% endhint %}

## Audit Log Export

### Create an Audit Export

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/audit/export" method="post" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

### List Audit Exports

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/audit/exports" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

### Download an Audit Export

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/audit/exports/download/{filename}" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

Exports are generated synchronously, stored as NDJSON, and downloaded through the authenticated Platform API path rather than a presigned, time-limited URL. Each export is capped at 50,000 events. Use the bare `{export_id}.ndjson` filename returned by the export surface when downloading.

Creating and downloading an export each records an audit event with `phi_accessed: true`, because an export can re-expose PHI access evidence.

Returns `503` if export storage is not configured for the deployment.

Requires `admin` or `owner` permissions.

## Compliance Reports

These reports provide compliance-oriented summaries and access evidence.

### Get the Compliance Dashboard

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/compliance/dashboard" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

### Get the HIPAA Evidence Report

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/compliance/hipaa" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

### Get the Access Review

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/compliance/access-review" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

All three require `admin` or `owner` permissions. Treat their responses as product evidence, not an independent certification or a complete assessment of the customer's control environment.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/platform-api/safety.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
