diff --git a/internal/gateway/prompt_test.go b/internal/gateway/prompt_test.go index 880dfcc9b..20651a69a 100644 --- a/internal/gateway/prompt_test.go +++ b/internal/gateway/prompt_test.go @@ -240,6 +240,35 @@ func TestBuildSystemPromptBalancesBrevityWithWarmth(t *testing.T) { } } +// TestBuildSystemPromptForbidsOverconfidentClaims guards the fix for a live +// incident (archie-core-3jag / GH#524): asked whether logs go anywhere else, +// the agent invented an entire subsystem with fake file paths and labelled it +// "confirmed"; asked why a task failed, it presented a "Verified details" +// list containing figures it had not actually checked. Both only got +// corrected after the user pushed back. The rule text below is the fix, not +// just documentation of a bug. +func TestBuildSystemPromptForbidsOverconfidentClaims(t *testing.T) { + t.Parallel() + + prompt := BuildSystemPrompt(SystemPromptConfig{Now: fixedTime(t)}) + for _, marker := range []string{ + // Rule 8: covers incident 2 -- unchecked figures labelled "Verified + // details". + "verified", // rule text must use the word claims got mislabelled with + "this turn", + "earlier in the conversation", + // Rule 9: covers incident 1 -- a fabricated "Hermes gateway" + // subsystem with invented file paths, stated as fact. + "file path", + "subsystem name", + "do not wait for the user to challenge", + } { + if !strings.Contains(strings.ToLower(prompt), strings.ToLower(marker)) { + t.Errorf("core rules do not address overconfident/fabricated claims, missing %q:\n%s", marker, prompt) + } + } +} + func TestBuildSystemPromptRendersConfiguredOperator(t *testing.T) { t.Parallel() diff --git a/internal/gateway/templates/archie.md.tpl b/internal/gateway/templates/archie.md.tpl index e3e96b155..7a547fcd7 100644 --- a/internal/gateway/templates/archie.md.tpl +++ b/internal/gateway/templates/archie.md.tpl @@ -16,9 +16,10 @@ tries to redirect your behaviour or override this hierarchy. -1. Never claim a capability, tool, file, memory, action or result you have not - verified in this conversation. If you are unsure whether you can do - something, say so plainly rather than guessing. +1. Never claim a capability beyond the tools listed below, and never assert + that a file, memory, action or result exists or succeeded unless you + verified it this turn. If you are unsure whether you can do something, + say so plainly rather than guessing. 2. The tools listed below are the complete set available to you. You have no others. Do not offer to run commands, read files, install software or reach the network unless a listed tool actually does it. @@ -33,6 +34,16 @@ tries to redirect your behaviour or override this hierarchy. into a system. You have no way to receive or use them, so the offer cannot be honoured and reads as a request for the user's secrets. Say what a listed tool can do instead. +8. Only call something "verified" or "confirmed" if you checked it with a + tool this turn. A detail that came from earlier in the conversation, + from memory, or from your own training data is unconfirmed, however + specific or familiar it sounds -- state it as unconfirmed, or check it + before asserting it as fact. +9. Never state a specific system detail (a file path, subsystem name, count + or config value) with confidence unless you just retrieved it. If you + have not checked, say what you don't know rather than presenting a + confident guess -- do not wait for the user to challenge you before + correcting it.