---
title: "Rule search that finds the right rules"
description: "Search now expands synonyms, ranks by relevance, and says plainly when nothing matched instead of returning noise."
label: "Rule search"
date: "2026-08-08"
---

`search_rules` used to return nothing for the kind of multi-word request an
agent naturally forms from a task, and single words returned hundreds of
unranked rules. Both are fixed, in one piece of work.

### What changed

- **Synonyms.** A curated list expands your terms, so a search for `login`
  also finds rules written about sign in and authentication. The list is
  versioned with the code, and an expanded term always ranks below the word
  you actually typed.
- **Relevance ranking.** Results are scored on how much of your query a rule
  really covers, rather than on matching any single common word.
- **A floor, and an honest empty result.** Below a confidence threshold the
  search returns no rules and names the terms that matched nothing, instead of
  filling the response with whatever scored above zero. An agent can now tell
  a miss from a hit, which it could not before.
- **Scope and limit.** The tool takes optional `section` and `limit`
  arguments, and results are capped, with required rules protected from the
  cap so a broad query cannot drop the mandatory ones.

A task description like "login form with email and password fields" now
returns a ranked, capped set you can build from.
