Files
portal/tools/enforce-mcp-classification.test.mjs
T

14 lines
551 B
JavaScript

import { describe, it, expect } from 'vitest';
import { decide } from './enforce-mcp-classification.mjs';
describe('enforce-mcp-classification decide()', () => {
it('allows non-mcp tools (no-op)', () => {
expect(decide({ toolName: 'Bash', toolInput: { command: 'ls' } }).block).toBe(false);
});
it('blocks an unknown mcp tool (default-deny)', () => {
const r = decide({ toolName: 'mcp__unknown__doSomething', toolInput: {} });
expect(r.block).toBe(true);
expect(r.reason).toMatch(/not in gate-config classification/);
});
});