---
title: "Let an agent reread rules whose sources · Agent Wranglers"
url: https://agentwranglers.se/playbook/engineering/documentation/recheck-sources-with-an-agent
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Let an agent reread rules whose sources changed

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

For AI agents: [llms.txt](https://agentwranglers.se/llms.txt) is a short guide that sends you to the rules your problem needs, and [rules.json](https://agentwranglers.se/playbook/engineering/rules.json) holds every rule of this playbook as JSON.

- Level: Optional
- Chapter: [Documentation](https://agentwranglers.se/playbook/engineering/documentation)
- Rule: When the source watch flags a rule, have an AI agent reread it against the current source. It proposes any fix as a pull request.
- How: Start from the list the [source watch](https://agentwranglers.se/playbook/engineering/documentation/watch-cited-sources) produces. To catch edits that keep the same address, store a hash of each source's main text and flag it when the hash changes. Give the agent the rule, the current source text and what changed. Ask for a structured answer of "still correct" or "changed", with the edited rule and a quote from the source. Open one pull request per run for a person to merge. Cap each run, such as 20 rules, to bound the cost. Test the agent's prompt as [Test changes to the agent setup on fixed tasks](https://agentwranglers.se/playbook/ai-assisted-development/measuring-and-improving/evaluate-agent-setup) says.
- Check: Flag one rule whose source contradicts it. The next run opens a pull request that edits that rule and quotes the source.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
const VERDICT_SCHEMA = {
  type: 'object',
  required: ['verdict', 'quote'],
  properties: {
    verdict: { enum: ['still correct', 'changed'] },
    quote: { type: 'string' },
    editedRule: { type: 'string' },
  },
};
```

### Python example

```python
from typing import Literal, Optional
from pydantic import BaseModel

class Verdict(BaseModel):
    verdict: Literal["still correct", "changed"]
    quote: str
    edited_rule: Optional[str] = None
```

## Related rules

- [Watch cited sources in code](https://agentwranglers.se/playbook/engineering/documentation/watch-cited-sources) in Engineering
- [Test changes to the agent setup on fixed tasks](https://agentwranglers.se/playbook/ai-assisted-development/measuring-and-improving/evaluate-agent-setup) in AI development

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/engineering/documentation/recheck-sources-with-an-agent">Agent Wranglers engineering playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Watch cited sources in code](https://agentwranglers.se/playbook/engineering/documentation/watch-cited-sources)
- [Documentation](https://agentwranglers.se/playbook/engineering/documentation)
