> For the complete documentation index, see [llms.txt](https://docs.concurrence.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.concurrence.com/design/safety-layers.md).

# Safety Layers Separate From the Agent Model

Why Concurrence puts safety controls beside the agent model instead of only in its prompt, what each layer enforces, and how to check it yourself.

## The Problem

An agent model follows its instructions most of the time, not every time. It can miss a described emergency, claim a booking that never happened, read out a record to the wrong caller, dial a number it found in a tool result, or stall mid-call. Adding more instructions to the prompt makes these failures less likely, but it can't stop them, because the same model that made the mistake is the one being asked to catch it.

## Our Design

Concurrence places controls at the boundaries the agent model can't cross on its own. Each layer acts outside the agent's reasoning: in the tool, in the call control, or between the reply and the caller.

| Layer                         | Where it acts                                             | What it does                                                                                                                                                                                                                                     |
| ----------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Caller verification**       | Built-in record tools                                     | Record reads return `verification_required` until the caller's full name and date of birth match one record through `world_confirm_patient_identity`; afterward they return only the caller's own record or a household member's that names them |
| **Write scope**               | Supported agent write tools                               | A server-side scope binds a model-originated write to an allowed workspace and entity                                                                                                                                                            |
| **Transfer destinations**     | Call control                                              | A dynamic `forward_call` dials only `approved_destinations`, each also on the line's forwarding allowlist. Public emergency and N11 short codes are refused as destinations                                                                      |
| **Reply checks**              | Between the reply and the caller                          | On platform-managed voice and `gpt_realtime`, a pattern check and a separate model check stop dosing advice, a diagnosis, record details shared before verification, and actions claimed as done without a matching successful write             |
| **Emergency script**          | Call control on `gpt_realtime`                            | A recognized medical emergency or self-harm line cuts off the agent's reply, and the model speaks an authored script first                                                                                                                       |
| **Emergency calls stay open** | Call control on platform-managed voice and `gpt_realtime` | After a described emergency, the agent's attempt to end the call is refused, apart from the `end_after_script` setting for a medical emergency described in English                                                                              |
| **Safe exit**                 | Call control on platform-managed voice and `gpt_realtime` | A call that can't set up, or a turn that gets no reply, plays fixed audio and transfers to the service's `fallback_to` or fixed forwarding number, or closes                                                                                     |
| **Approval gate**             | Text conversations                                        | A gated integration endpoint or `approval_required` skill waits for an authorized approve or reject decision before it runs                                                                                                                      |

Some protections remain model guidance. The crisis resource in the agent's instructions, the rule against following instructions inside tool results, and the paths for a request for a person are text the agent model reads. They improve behavior and are not enforced checks.

## What It Guarantees

* On a caller-facing session, a built-in `world_*` record read before verification returns no record, whatever the agent model asks for. Operator-anchored, simulation, and test sessions are not gated, and a service with `platform_caller_verification: false` refuses those reads with `verification_off` for the whole conversation.
* A dynamic transfer dials only an approved, allowlisted number, and never a public emergency or N11 short code.
* On platform-managed voice and `gpt_realtime`, a call whose agent can't be set up, or a turn that gets no reply, ends in fixed lines prepared ahead of time rather than silence.

The reply checks are a check, not a guarantee: they review every voice reply, but either check can miss a phrasing or stop a correct reply. Test your confirmation wording.

## What It Doesn't Cover

* **Recognition is narrow.** Emergency and self-harm recognition covers a limited set of phrasings in English and Spanish and can miss others or fire when a caller only mentions a condition. The crisis rule covers suicidal thoughts, self-harm, and an overdose. Any other missed emergency rests on the agent's own instructions.
* **Text checks only log.** The text reply check records a hit and sends the reply as written.
* **Coverage depends on the runtime.** The emergency script, the safe exit, and the voice reply checks are documented for platform-managed voice and `gpt_realtime`. Check [Runtime Safety](https://docs.concurrence.com/operations-and-safety/runtime-safety.md#control-map) for the scope of each control before you choose a voice family.
* **Integration reads aren't gated by caller verification.** Patient reads through your own integration endpoints follow the agent's instructions, not the built-in check.
* **No automatic clinical triage.** Your organization authors, tests, and staffs its clinical escalation protocols.

## Verify It Yourself

1. On a test service, start a text or voice test session with a caller who matches a synthetic record by phone number. Ask for an appointment before verifying, and confirm in the tool calls that the read returned `verification_required`.
2. In dynamic forwarding mode, ask the agent to transfer to a number outside `approved_destinations`, and confirm that `forward_call` refuses it without dialing.
3. On a voice test call, ask the agent to confirm a booking before any booking tool runs, and confirm in the transcript that the reply was stopped and corrected.
4. On a `gpt_realtime` test call, describe a medical emergency in plain words and in hinted words, then a non-emergency mention of a condition, and compare what played.
5. Read [Runtime Safety](https://docs.concurrence.com/operations-and-safety/runtime-safety.md) and [Safety & Escalation](https://docs.concurrence.com/developer-guide/platform-api/conversations/voice-agent#safety-and-escalation) for the full behavior, then follow [Add Escalation and Safety](https://docs.concurrence.com/developer-guide/guides/escalation-and-safety) to configure and test it.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.concurrence.com/design/safety-layers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
