cleandataengineering.aiAgent Harness, drawn simply
You are here: End to end › Checks › 3 · After the model › money_in_rupees

Agent Harness Tutorial · End to end · Zoom level 3

How we take care of it: money_in_rupees

money_in_rupees catches £ or $ amounts (it caught a real "£25,000").

Open: 11before loopopen ›Open: 22before modelopen ›Open: 33after modelopen ›Open: 44before toolopen ›Open: 55the toolopen ›Open: 66after toolopen ›Open: 77after loopopen ›Open: 88before replyopen ›It readsevery amount in the replymoney_in_rupeesrule · agentpassCarries onfailIf it failssafe replyWHERE IN THE CODE: F policy rules · evaluators.yaml reply
The strip at the top shows every check point where this check runs, in dark.

How we took care of it.

  1. Amounts must be in rupees (₹). £, $ or € fails.
It readsevery amount in the reply
Kindrule
Provided byagent
If it failssafe reply
Where in the codeF policy rules · evaluators.yaml reply
Runs at3 · After the model, 8 · Before the reply
Real exampleIt caught a real answer that said "£25,000".

How it is done: the real code

Cut from the live repositories each time the site is built, so it always matches what runs.

def money_in_rupees(ctx: Context) -> Verdict:
    """F-25: an amount is stated in rupees (₹, Rs or INR, or bare), never £, $ or €.

    The real model wrote "£25,000" for a payout of ₹25,000, and every rule passed
    it: the figure was grounded and nothing read the symbol. A right number in
    the wrong currency is a wrong statement about money, so it is refused like
    an ungrounded one. Placed by `evaluators.yaml`; saying the currency in the
    prompt is the fix that makes this rule rarely fire."""
    found = FOREIGN_MONEY.search(ctx.text)
    if found:
        said = found.group(0).strip()
        return block("money_in_rupees", f"stated an amount as {said!r}; money here is in rupees")
    return ALLOW