Skip to main content

Policy focus

Ensuring your agent stays focused on the right details​

Policy focus is how Parlant makes sure the model pays attention to the rules that apply right now, not only has them somewhere in its prompt. Models attend most to the end of their input, so Parlant places a short reminder of this turn's matched rules there. This matters most for long policies, where one key sentence can get lost.

What you'll learn
  • Why having a rule in the prompt is not enough
  • How the model's input is laid out, and where the reminder goes
  • Which rules get a reminder and which do not
  • Why important restrictions belong in their own policy
Talk this page through with your coding agent

Once the engine knows which rules matter this turn, it still has to decide how to present them to the language model. That choice has a large effect on the quality of the model's attention.

Say your agent has a return policy that runs to a full page: eligibility windows, what to do about damaged items, and so on. A customer writes in about a gift with no receipt, and the one sentence in your rules that matters to this case is buried somewhere in the middle of the prompt.

The model has the rules in its prompt, so it knows the answer. But even though it knows it, will it actually attend to that one sentence, on this turn, with everything else in the prompt competing for its attention? For an assistant, "usually" might be fine. For your customer-facing agent, especially at scale, it is not.

To counter this risk of overlooking nuances, Parlant introduces policy focus.

Policy focus uses a consistent trait of language models: they pay more attention to information toward the end of the context window (that is, their input). It works by placing a reminder about the currently matched rules toward the end of the context, so that the model attends to them more consistently.

Where the reminder goes​

To see why the placement matters, it helps to know how Parlant lays out the model's input. On each step it has two parts, and policy focus lives in the second one.

The standing instructions hold your agent's identity, its general guidance, and the full text of every rule in the working set (the rules discovered so far in the session). They change slowly. That is what lets the provider's prompt cache (its reuse of an unchanged prompt prefix) serve them efficiently from turn to turn.

The live tail is different. Parlant rebuilds it on every step, and it is the last thing the model reads before it writes. This is where Parlant puts the currently matched rules, each with the reason it applies right now.

Note that the live tail is not only rules. Tool results, canned responses, and step guidance live there too. That is part of why reminders are kept short, as the next section shows.

Cached prefix
reused across turns
Agent identity and general instructions
Customer, and resolved variables
Terms the conversation has brought in
Standing rules: low-weight and cross-referential
Working set of discovered rulesrendered as "may or may not apply right now"
Live tail
rebuilt every step
Reminders for this turn's matched rulesHigh-weight rules are restated inline
Deprioritized rules: "do not act on these this turn"
Reminders for the most relevant tools for this turn
Relevant canned responses for this turn
Retrieved data/knowledge for this turn
The responder's input on one step. The prefix is what the provider's prompt cache reuses from turn to turn; the tail is rebuilt every step.

Rules that are known but not in focus​

Not every rule in the prompt gets a reminder, and that is deliberate.

Rules that Parlant discovered but did not match on this turn sit in the standing instructions, where Parlant marks them as rules that may or may not be relevant right now. The model may weigh them, but nothing beyond its normal attention works to draw it to them specifically.

There is also the case of rules that matched but lost a priority contest. Parlant renders them in an explicit note that says not to act on them this turn. Leaving them out would not be enough, since their full text is still in the standing instructions and the model would have no reason not to follow them.

Note that policy focus only works for rules that have been matched and found truly relevant to the current turn. If a rule is only discovered, and not evaluated, it does not benefit from policy focus.

What this means for how you write policies​

A restriction buried in one of your long policies may sometimes still slip. The reminder highlights the policy that is relevant to the conversation, not the restriction buried within it.

This is why, if a restriction must stay in focus no matter what the conversation is about, you should split it into its own policy. If it must hold even when the customer pushes back, raise its weight as well. Your coding agent can make both changes.

note

Compass Pro does support highlighting relevant parts of the policy in the live tail, so that you don't need to split your policies up manually to manage this focus issue. To learn more about Compass Pro, see the documentation.

To learn more, see Rule matching, which covers how a rule earns the match that puts it in focus, and Designing policies, which covers splitting and weighting policies in practice.