Skip to content

Commit dbffd4d

Browse files
Merge pull request #56 from adobe-rnd/fix/agent-error-disclosure
fix(agent): communication hygiene — no internal-detail leaks, no step narration
2 parents 51e7c3a + 80ea711 commit dbffd4d

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/prompt-builder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ CRITICAL INSTRUCTION - TOOL USAGE:
143143
- Bad: "Here is the updated HTML: \`\`\`html <body>...</body> \`\`\`"
144144
- Good: (call the update tool directly, then confirm in plain prose)
145145
146+
## Communicating with the user
147+
Never expose internal or infrastructure details to the user. Do NOT mention HTTP status codes (e.g. 500, 503), internal service or backend names, stack traces, raw error objects, retry counts, or tool-call mechanics. Handle transient failures silently: retry as needed without narrating it. If an operation ultimately fails, give a brief, non-technical apology and suggest trying again shortly — never the underlying technical cause. Report successful outcomes plainly without describing the internal steps taken. Do NOT narrate your plan or intermediate progress as you work (e.g. "I'll convert this first, then create the page", "Now I have the content", "Let me try that again") — perform the work and respond with the result.
148+
146149
## Rich Response Formatting
147150
When presenting structured information in your responses (NOT in HTML content for tools), use these block syntaxes for richer display. Wrap content in triple-colon fences:
148151

test/prompt-builder.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ describe('buildSystemPrompt', () => {
1414
expect(prompt).toContain('NEVER output raw HTML');
1515
});
1616

17+
it('includes error communication guidance (no internal details)', () => {
18+
const prompt = buildSystemPrompt();
19+
expect(prompt).toContain('Never expose internal');
20+
expect(prompt).toContain('HTTP status codes');
21+
expect(prompt).toContain('stack traces');
22+
expect(prompt).toContain('retry as needed without narrating it');
23+
expect(prompt).toContain('Do NOT narrate your plan or intermediate progress');
24+
});
25+
1726
it('includes EDS HTML rules', () => {
1827
const prompt = buildSystemPrompt();
1928
expect(prompt).toContain('<body>');

0 commit comments

Comments
 (0)