Add exact tool-name permission overrides for permanent agent tool usage. - Add persisted toolRules policy support with normalization, project-default inheritance, and escalation comparison. - Enforce exact tool dispositions before category rules in engine gating and permanent-agent decisions. - Extend the permission editor, agent/settings routes, translations, docs, and tests for fine-grained tool controls. Files changed: .changeset/fn-7361-tool-permissions.md | 7 + docs/agents.md | 18 ++- docs/settings-reference.md | 12 +- .../agent-permission-policy-resolution.test.ts | 58 +++++++- .../src/__tests__/agent-permission-policy.test.ts | 17 +++ ...settings-schema-agent-permission-policy.test.ts | 6 +- packages/core/src/agent-permission-policy.ts | 87 ++++++++++-- packages/core/src/index.ts | 2 +- packages/core/src/types.ts | 19 ++- .../dashboard/app/components/AgentDetailView.tsx | 17 +-- .../app/components/AgentPermissionPolicyEditor.css | 59 +++++++- .../app/components/AgentPermissionPolicyEditor.tsx | 156 ++++++++++++++++++++- .../__tests__/AgentPermissionPolicyEditor.test.tsx | 92 +++++++++++- .../settings/sections/AgentPermissionsSection.tsx | 6 +- .../dashboard/src/__tests__/routes-agents.test.ts | 79 +++++++++++ .../src/__tests__/routes-settings.test.ts | 21 +++ .../src/routes/register-agent-core-routes.ts | 37 +++-- .../agent-action-gate-project-default.test.ts | 34 +++++ .../engine/src/__tests__/agent-action-gate.test.ts | 43 ++++++ .../src/__tests__/gating-classifications.test.ts | 55 ++++++++ packages/engine/src/agent-action-gate.ts | 17 ++- packages/engine/src/permanent-agent-gating.ts | 11 +- packages/i18n/locales/en/app.json | 15 +- packages/i18n/locales/es/app.json | 15 +- packages/i18n/locales/fr/app.json | 15 +- packages/i18n/locales/ko/app.json | 15 +- packages/i18n/locales/zh-CN/app.json | 15 +- packages/i18n/locales/zh-TW/app.json | 15 +- 28 files changed, 878 insertions(+), 65 deletions(-) Fusion-Task-Id: FN-7361 Fusion-Task-Lineage: 006e4311-91a5-4792-9a54-feaba892129a Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
139 lines
2.6 KiB
CSS
139 lines
2.6 KiB
CSS
.agent-policy-editor {
|
|
padding: var(--space-lg);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-lg);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-md);
|
|
}
|
|
|
|
.agent-policy-table {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.agent-policy-row {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
|
|
gap: var(--space-md);
|
|
padding: var(--space-sm);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-md);
|
|
background: var(--surface);
|
|
}
|
|
|
|
.agent-policy-cell {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-xs);
|
|
}
|
|
|
|
.agent-policy-description {
|
|
color: var(--text-muted);
|
|
font-size: 0.75rem;
|
|
}
|
|
|
|
.agent-policy-inherit-note {
|
|
color: var(--text-dim);
|
|
font-size: 0.75rem;
|
|
}
|
|
|
|
.agent-policy-examples,
|
|
.agent-policy-exempt-list {
|
|
margin: 0;
|
|
padding-left: var(--space-xl);
|
|
display: grid;
|
|
gap: var(--space-xs);
|
|
}
|
|
|
|
.agent-policy-examples code,
|
|
.agent-policy-exempt-list code {
|
|
font-family: var(--font-mono);
|
|
font-size: 0.75rem;
|
|
}
|
|
|
|
.agent-policy-tool-rules {
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-md);
|
|
background: var(--surface);
|
|
padding: var(--space-sm);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.agent-policy-tool-rules h4,
|
|
.agent-policy-tool-rules p {
|
|
margin: 0;
|
|
}
|
|
|
|
.agent-policy-tool-rules p,
|
|
.agent-policy-tool-empty {
|
|
color: var(--text-muted);
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.agent-policy-tool-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.agent-policy-tool-row,
|
|
.agent-policy-tool-add {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) minmax(9rem, 12rem) auto;
|
|
gap: var(--space-sm);
|
|
align-items: end;
|
|
}
|
|
|
|
.agent-policy-tool-row label,
|
|
.agent-policy-tool-add label {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-xs);
|
|
min-width: 0;
|
|
}
|
|
|
|
.agent-policy-tool-row .input,
|
|
.agent-policy-tool-add .input {
|
|
width: 100%;
|
|
}
|
|
|
|
.agent-policy-exempt {
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-md);
|
|
background: var(--surface);
|
|
padding: var(--space-sm);
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.agent-policy-exempt summary {
|
|
cursor: pointer;
|
|
color: var(--text);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.agent-policy-exempt p {
|
|
margin: var(--space-sm) 0;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.agent-policy-row,
|
|
.agent-policy-tool-row,
|
|
.agent-policy-tool-add {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.agent-policy-tool-row .btn,
|
|
.agent-policy-tool-add .btn {
|
|
width: 100%;
|
|
}
|
|
|
|
.agent-policy-examples,
|
|
.agent-policy-exempt-list {
|
|
padding-left: var(--space-lg);
|
|
}
|
|
}
|