Skip to content

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.

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.

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.

The last chunk of every agent reply carries a named outcome and the citations:

OutcomeMeaning
GROUNDEDThe answer cites at least one retrieved passage.
NO_CONTEXTNothing relevant was found; the reply is the refusal.
UNCITEDThe 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.

SettingDefaultLimit
Top-K (passages retrieved)6at most 20
Similarity threshold0.55

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 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.