From a6e476b8512717fd4c12992b9f859be4c0d75e90 Mon Sep 17 00:00:00 2001 From: Giorgio Gilestro Date: Fri, 29 May 2026 14:26:37 +0200 Subject: [PATCH] review: reject financial advice in indicator-summary reads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a new UNCLEAN criterion to the reviewer agent's system prompt: direct recommendation language (buy/sell/hold/accumulate/trim/rotate), allocation guidance (overweight/underweight, "X% in bonds"), price targets, and personalised framing ("you should", "investors should") all trigger a reject. The operator is not licensed to give investment advice; this is editorial commentary on public data. The generator's system prompt already forbids buy/sell language, but a prompt-only constraint is not an enforcement layer. The reviewer agent — already in the pipeline for chain-of-thought / truncation / meta-commentary — is the right place to enforce the regulatory boundary structurally: rows that drift into advice get dropped, and the API falls back to the previous compliant row. Descriptive / interpretive language about market state remains explicitly allowed ("valuations are stretched", "real yields are restrictive"). The criterion is state vs action: states publish, actions don't. Co-Authored-By: Claude Opus 4.7 --- app/services/output_review.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/services/output_review.py b/app/services/output_review.py index 401096d..833b927 100644 --- a/app/services/output_review.py +++ b/app/services/output_review.py @@ -60,7 +60,22 @@ Mark UNCLEAN if the text contains ANY of: - Partial / truncated content. Starts mid-word, mid-number, mid-clause. - Visible internal numbers without clear meaning ("change 1y +5.9%?"), raw column names ("as_of 2026-01-01"), or any debug-like fragments. -- Anything other than the finished, publishable interpretation. +- FINANCIAL ADVICE or any phrasing that recommends an action the + reader should take. This service is editorial commentary on public + data, not investment advice; the operator is not licensed to give + it. Reject any of: + * Buy/sell/hold/accumulate/trim/exit/enter/rotate language. + * Allocation guidance ("overweight", "underweight", + "X% in bonds", "increase exposure to"). + * Price targets or specific level predictions ("will reach $X", + "target Y", "expect Z by year-end"). + * Personalised framing ("you should", "investors should", + "consider buying", "we recommend"). + DESCRIPTIVE / INTERPRETIVE language about market state is fine — + "valuations are stretched", "real yields are restrictive", "rates + and credit disagree". The test: does the text describe a STATE, or + does it suggest an ACTION? States are fine; actions are not. +- Anything else other than the finished, publishable interpretation. Return ONLY a JSON object with this exact shape: {"clean": true | false, "reason": "<≤20 words, plain text>"}