mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
feat(policy): add source tracking to policy rules (#16670)
This commit is contained in:
@@ -72,6 +72,7 @@ describe('policiesCommand', () => {
|
||||
{
|
||||
decision: PolicyDecision.ALLOW,
|
||||
argsPattern: /safe/,
|
||||
source: 'test.toml',
|
||||
},
|
||||
{
|
||||
decision: PolicyDecision.ASK_USER,
|
||||
@@ -101,7 +102,9 @@ describe('policiesCommand', () => {
|
||||
expect(content).toContain(
|
||||
'1. **DENY** tool: `dangerousTool` [Priority: 10]',
|
||||
);
|
||||
expect(content).toContain('2. **ALLOW** all tools (args match: `safe`)');
|
||||
expect(content).toContain(
|
||||
'2. **ALLOW** all tools (args match: `safe`) [Source: `test.toml`]',
|
||||
);
|
||||
expect(content).toContain('3. **ASK_USER** all tools');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -53,6 +53,9 @@ const listPoliciesCommand: SlashCommand = {
|
||||
if (rule.priority !== undefined) {
|
||||
content += ` [Priority: ${rule.priority}]`;
|
||||
}
|
||||
if (rule.source) {
|
||||
content += ` [Source: \`${rule.source}\`]`;
|
||||
}
|
||||
content += '\n';
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user