fix(bridge): 拦截商机引用泄露
This commit is contained in:
@@ -194,3 +194,17 @@ test('guard: CRM wording is replaced with a colleague follow-up, not a cart note
|
||||
assert.match(r.content, /request has been noted/i);
|
||||
assert.doesNotMatch(r.content, /account cart/i);
|
||||
});
|
||||
|
||||
test('guard: strips leaked opportunity reference labels', () => {
|
||||
const r = guardReply({
|
||||
content: '🎯\n**Opportunity reference**: *Acme GmbH — 500 rings*\nOur sales team will contact you shortly.',
|
||||
toolResults: [{ created: true, opportunity_id: 'opp-1' }],
|
||||
toolCalls: [{ name: 'create_opportunity', ok: true }],
|
||||
lang: 'en',
|
||||
});
|
||||
assert.equal(r.blocked, true);
|
||||
assert.ok(r.reasons.includes('internal_crm'));
|
||||
assert.doesNotMatch(r.content, /opportunity/i);
|
||||
assert.match(r.content, /sales team will contact you/i);
|
||||
assert.doesNotMatch(r.content, /account cart/i);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user