feat(FN-3560): add permanent agent gating enforcement in pi with tool class
The merge lands three major features: a permanent-agent gating system (FN-3560, 6 steps) that classifies and enforces tool access policies for permanent agents in the PI extension, with full test coverage and updated agent docs; an OpenClaw MCP bridge (FN-3717) adding MCP config, schema server, and Fusion-Task-Id: FN-3560
This commit is contained in:
@@ -609,7 +609,7 @@ export class HeartbeatMonitor {
|
||||
taskId,
|
||||
runId,
|
||||
targetAction: {
|
||||
category: decision.category === "exempt" ? "shell-command" : decision.category,
|
||||
category: decision.category === "exempt" ? "command_execution" : decision.category,
|
||||
action: decision.operation,
|
||||
summary: decision.summary,
|
||||
resourceType: decision.resourceType,
|
||||
@@ -624,6 +624,16 @@ export class HeartbeatMonitor {
|
||||
};
|
||||
}
|
||||
|
||||
private buildPermanentAgentGatingContext(agent: Agent): { permissionPolicy: ReturnType<typeof resolveEffectiveAgentPermissionPolicy> } | undefined {
|
||||
if (isEphemeralAgent(agent)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
permissionPolicy: resolveEffectiveAgentPermissionPolicy(agent.permissionPolicy),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the heartbeat monitoring loop.
|
||||
* Safe to call multiple times - no-op if already running.
|
||||
@@ -1835,6 +1845,7 @@ export class HeartbeatMonitor {
|
||||
// Skill selection: use waking agent's skills (heartbeat has no role fallback)
|
||||
...(skillContext.skillSelectionContext ? { skillSelection: skillContext.skillSelectionContext } : {}),
|
||||
actionGateContext: this.buildActionGateContext(agent, taskId, run.id),
|
||||
permanentAgentGating: this.buildPermanentAgentGatingContext(agent),
|
||||
});
|
||||
|
||||
// Track for monitoring
|
||||
|
||||
Reference in New Issue
Block a user