Agents and grounding
An agent is a saved configuration: a model, a system prompt, a knowledge base, retrieval settings, optional tools and an answer language. Agents are private to their owner by default and can be shared.
Grounding is enforced on the server
Section titled “Grounding is enforced on the server”A chat request for an agent carries only the agent’s id and the conversation. The chat service loads the agent with the caller’s own token, so a user can only chat with agents they can see, and then sets everything else on the server:
- the system prompt
- retrieval: the agent’s one knowledge base, filtered by subscription and knowledge base, with the agent’s top-K and similarity threshold
- tools, model and temperature
A prompt, retrieval filter or tool list sent by the client is ignored for agent chats. A modified client can’t widen what the agent reads.
Strict mode
Section titled “Strict mode”An agent’s grounding mode is OFF or STRICT. In strict mode:
- The retrieved passages are numbered, and the model must answer from them only and cite each claim as
[n]. - The agent has no tools, so nothing outside the knowledge base can enter the answer.
- When retrieval finds nothing relevant, the agent refuses: it says it couldn’t find the answer and points to the contact set on the agent (text, URL or email), or uses a fallback message you write.
- An answer without a valid citation is treated as no answer and replaced by the refusal. The agent’s owner can still see the draft.
- The answer is in the user’s language, or in the agent’s answer language if you set one.
What the client receives
Section titled “What the client receives”The last chunk of every agent reply carries a named outcome and the citations:
| Outcome | Meaning |
|---|---|
GROUNDED | The answer cites at least one retrieved passage. |
NO_CONTEXT | Nothing relevant was found; the reply is the refusal. |
UNCITED | The model answered without a valid citation; the reply is replaced by the refusal. |
Each citation has its number, the source URL and title, and the knowledge base item it came from. Foundry UI shows [n] as links that open the source page, plus a deduplicated Sources list under the answer.
Retrieval settings
Section titled “Retrieval settings”| Setting | Default | Limit |
|---|---|---|
| Top-K (passages retrieved) | 6 | at most 20 |
| Similarity threshold | 0.55 |
Prompt injection
Section titled “Prompt injection”Crawled pages can contain text written to steer a model. The support agent’s evaluation cases include prompt-injection probes, in English and Arabic, next to answerable and unanswerable questions. When the model provider’s content filter blocks a request, the API answers 400 instead of passing on the provider’s error.
The support-agent template
Section titled “The support-agent template”The support-agent template creates a strict agent from a knowledge base in one step: name, site name and contact, strict grounding on, no tools. Foundry UI offers it as Create from website; the API is POST /v1/{subscription}/templates/support-agent on the agent service. See Support agent from a website.
The decision record is ADR-0008 in Architecture decisions.