Skip to content

AI safety

FACE’s agents read a customer’s records and propose actions. The controls on this page sit at the points where untrusted text reaches a model, and where a model’s output could turn into an action. None of them makes a language model safe against a determined adversary. Together they make attacks harder and bound what an attack can achieve, and each one says where it stops.

Two kinds of untrusted text

FACE treats text a caller types differently from content the platform fetched, because the two carry different risks.

Caller commands: screened before any model call

FACE screens every prompt in layers before it reaches a model. A prompt that is refused never reaches the model, the caller is told it was refused, and the refusal is audited.

Fetched content: fenced as untrusted data

Connector rows, page text, OCR output and earlier model answers derived from them are wrapped by ai.FenceUntrusted before they reach a prompt:

  • Instruction. The model is told explicitly that the fenced block is untrusted data to analyse, that it carries no authority, and that instructions inside it are part of the data and must never be obeyed.
  • An unguessable delimiter. The fence markers are drawn fresh and at random for each call, so content cannot close its own fence.
  • No bytes changed. The content appears verbatim, so legitimate records are not mangled.

OpenBias guardrails

Each agent service has a judge built from a versioned rule set. The rule files ship with the backend, and each one names in its header the judge that enforces it; a rule file with no judge fails the test suite. A matching rule refuses the request with PermissionDenied and writes a PROMPT_REJECTED audit record, with the actor ID hashed.

The rules cover security abuse (such as prompt injection and attempts to tamper with the audit trail) and bias and ethics (such as discriminatory decisions).

The documentation and the code are checked against each other:

  • Parity. TestDocumentedRulesMatchGetJudge compares every documented rule with what the judge actually compiles. A rule documented with no code behind it fails, and so does code with no documentation.
  • Firing. The firing tests run the real judge, and every rule must fire on its own documented example.

The agent loop fails closed

The ReAct loop (ExecuteLoop) looks up the guardrail mapping for the requested agent. An agent ID with no mapping is refused with a FailedPrecondition that names it as a server-side configuration defect. The loop never runs an unguarded agent. The agent ID is passed through filepath.Base before it is used as a path, so a request cannot choose which template file becomes the system prompt. TestUnmappedAgentIdCannotReachTheLoop and TestAgentIdCannotEscapeTheTemplateDirectory pin both behaviours.

The voice line

The phone line is the one prompt path a person can reach without an account. Every caller utterance is screened before any model is called.

A refusal is spoken to the caller as a sentence. It is not an error, because an error on this path would be silence on the line. The prompt is never built and the model is never called. TestRefusedUtteranceNeverReachesTheModel proves this with a model client that fails the test if anything calls it. Refusals are audited.

The carrier’s webhooks require a valid request signature, and the media socket requires a short-lived token that FACE minted. See Identity & access.

Judging proposed actions

When an agent’s final answer proposes logistics actions, each action is judged before it is accepted. The judge is the shared judging ladder (inference/judgement), running in process. Its one model question goes to the same inference plane as every other model call.

  • Evidence is what the run gathered. Evidence is the data this run fetched and the observations its tools made, passed inside an untrusted fence. The proposer’s own rationale is never treated as evidence for its proposal.
  • Dissent removes the action. An action the judge dissents from is removed from the answer. It is kept only as a record with accepted=false, and never served as a recommendation.
  • “Unable to judge” is never shown as agreement. An action that was not judged is marked as such and is never silently accepted.
  • The verdicts stay in FACE. No verdict is written to another platform’s store.

The setting FACE_RALPH_JUDGEMENT controls the judge, and FACE_RALPH_JUDGE_MAX_ACTIONS and FACE_RALPH_JUDGE_REVISIONS bound its cost.

Bounding what agents may do

A mitigation against injection has to be paired with limits on what model output can cause:

  • Agent email is always a draft. An email an agent composes is created as a draft in the operator’s mailbox for a person to read and send; no agent sends mail on its own (owner rule, 2026-10-03), whatever FACE_AGENT_EMAIL_ALLOWLIST or the decision-authority policy says (see Auditability & lineage). Both are still evaluated, and the draft is audited with the recipient hashed, so the record shows what the policy would have allowed.
  • Proposed actions are bounded. Every action an agent proposes is checked against that agent’s allowlist of action kinds and approver roles and its OpenBias rules before it is shown, high-risk action kinds (such as moving money) are refused for every agent, and links to hosts outside FACE_OUTPUT_URL_HOSTS are removed from answers. Nothing an agent proposes runs until a named person approves it. The one exception is self-healing of FACE’s own runtime (restarting a runner, tripping a circuit breaker, scaling, rolling back), which runs automatically by the owner’s decision, behind its own fixed list of actions and a kill switch.
  • Tool gating. Agent tools are authorised through the security policy engine, against the verified subject of the request. A service-account token holds the Reader tier and cannot reach write-tier tools.
  • Read-only SQL. Agent-issued and user-issued SQL both go through the same read-only check as every other query. See Network egress controls.

Structured output (TOON)

Model output is parsed as TOON (Token-Oriented Object Notation) into dedicated intermediate structs, then mapped into FACE’s own types. Output is never unmarshalled directly into API messages, and a malformed answer is refused as TOON_PARSE_FAILURE. FACE does not use JSON-schema wrappers or LLM orchestration frameworks.

One exception is documented and bounded: object detection in camera frames asks the vision model for boxes in the model’s native bbox_2d JSON format, because measurement shows no other format localises reliably. Those boxes are parsed into FACE’s own structs immediately. Every verdict about a frame still travels as TOON.

Scope of these controls

  • Indirect prompt injection is an unsolved problem. Fencing makes injection materially harder. The real limit is what output is allowed to do, which is why the controls above cap agent actions.
  • Guardrails reduce risk; they do not remove it. Tests prove the rules fire. They do not prove the rules catch every harmful request.
  • A judge verdict is a model’s judgement. It is a check, not proof. Keep a human in the loop for consequential actions.