Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Remove the inert Assistant Protected guests setting

rcourtman1d6d2bfcaedf
diff --git a/docs/AI.md b/docs/AI.md
index 084b114eac..daa739f3e4 100644
--- a/docs/AI.md
+++ b/docs/AI.md
@@ -487,9 +487,11 @@ Older saved `autonomous` preferences display as **Ask first**, not as permission
to execute without approval. The stored preference and its existing entitlement
checks are preserved for older clients.
-**Protected guests (legacy)** retains older VMIDs or names. This list does not
-exclude saved action plans. Review each plan’s target and approval policy in
-**Actions** instead of treating this list as an execution safeguard.
+To keep Assistant away from a specific guest, lock it: open the guest, choose
+**Manage**, turn on **Never auto-remediate** under Operator overrides, and save.
+Pulse then refuses typed actions that target that resource, including
+approved ones. Older versions also showed a **Protected guests** list here. It
+never excluded a guest from action plans, so it has been removed.
### Reviewing an Assistant action plan
diff --git a/docs/AI_AUTONOMY.md b/docs/AI_AUTONOMY.md
index e090c6931e..d5f28ddb05 100644
--- a/docs/AI_AUTONOMY.md
+++ b/docs/AI_AUTONOMY.md
@@ -109,9 +109,12 @@ entitlement checks for older clients. It does not bypass approval. An unrelated
settings save does not rewrite that preference. Unknown values fail closed to
read-only. Patrol mode and Autopilot acknowledgements remain separate.
-**Protected guests (legacy)** retains older VMIDs or names. This list does not
-exclude saved action plans. Review each plan’s target and approval policy in
-**Actions** instead of treating this list as an execution safeguard.
+To keep Assistant away from a specific guest, lock it: open the guest, choose
+**Manage**, turn on **Never auto-remediate** under Operator overrides, and save.
+Pulse then refuses typed actions that target that resource, including
+approved ones (see [Keep a Resource Off-Limits](#keep-a-resource-off-limits)).
+Older versions also showed a **Protected guests** list here. It never excluded a
+guest from action plans, so it has been removed.
### Configuration
@@ -189,6 +192,10 @@ The assistant cannot operate on resources it hasn't first discovered. This preve
After executing any control action, the assistant must verify the result with a read operation before reporting success. This is enforced by the FSM — the assistant cannot return to idle state without verification.
+### Keep a Resource Off-Limits
+
+To stop Pulse acting on a specific guest, host or container, open its drawer, choose **Manage**, turn on **Never auto-remediate** under Operator overrides, confirm the prompt, and click **Save overrides**. Pulse then refuses typed actions that target that exact resource: the Assistant declines to plan one when it can read the lock, Patrol will not run one, and the action lifecycle checks the lock again before it runs an action that was already planned, even when approved. The lock covers that resource only, not its host or other resources, and it does not stop read-only investigation. Turn it off and save again when you want Pulse to act on the resource again. A resource whose lifecycle is Retired is blocked the same way until the lifecycle is set back to Active.
+
---
## Recommended Progression
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 6a8d9af826..4813066fc1 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -25,9 +25,10 @@ then checks explicit read-only opt-out and later opt-in remain possible.
AI settings responses project legacy Assistant levels to planning for review;
this grants no agent command, enrolment, identity or transport authority.
-The retained legacy Protected guests list does not exclude canonical saved
-plans. Authenticated execute authority and the action approval policy remain
-separate from that configuration list.
+There is no Protected guests list: the retired setting never excluded canonical
+saved plans. A resource's Never auto-remediate lock, authenticated execute
+authority and the action approval policy are separate authorities, and none of
+them is configured from the AI settings projection.
Existing agent report/command and shared capability vocabularies remain
unchanged, including their separate approval and entitlement enforcement.
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 7c91c126ce..c239e39fde 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -89,15 +89,16 @@ legacy command-approval selection. `TestAssistantProjectedModeEchoPreservesLegac
uses actual encrypted GET/PUT persistence with and without the entitlement,
then checks explicit read-only opt-out and later opt-in remain possible.
-### Legacy protection copy is not a canonical-plan guarantee
+### Assistant protection is the per-resource lock, not a settings list
-The retained Protected guests list is older configuration, not a filter of
-canonical saved resource plans. Settings and both existing help pages must
-state that limitation and direct the operator to Actions target/approval review.
-The value is preserved on unrelated saves. Mounted component, accessible
-description and mirrored-help checks prevent a false exclusion promise.
-`TestService_isAutonomousModeEnabled` also covers every current saved level,
-explicit core-owned investigation enable/disable and unchanged stored values.
+Settings no longer offers a Protected guests list, because it never filtered
+canonical saved resource plans. The Assistant settings panel points the operator
+at the resource's Never auto-remediate lock, and both existing help pages say
+the same and state that the list is gone. The settings component, the
+`settingsArchitecture` source pin and the mirrored-help checks prevent a
+restored exclusion promise. `TestService_isAutonomousModeEnabled` also covers
+every current saved level, explicit core-owned investigation enable/disable and
+unchanged stored values.
### Interactive Assistant modes reflect action planning
@@ -8554,6 +8555,33 @@ separate recorded steps, and the current Actions controls own their ordering.
A prepared plan awaiting approval is not an executed write. A subsequent read,
self-reported verification flag or successful call cannot establish recovery.
+`pulse_control` also declines to plan when the target's operator state blocks
+remediation (`NeverAutoRemediate`, or a retired lifecycle).
+`assistantTypedActionPlanner` (`internal/api/assistant_typed_action_planner.go`)
+reads that state through the tenant-scoped lifecycle store
+(`actionlifecycle.Service.ResourceOperatorState`, the same read Patrol's broker
+and dispatch use, not the chat executor's own audit store) and returns
+`unifiedresources.ErrResourceRemediationLocked` before `Plan`, so no plan is
+written. `controlPlanFailureResult` turns that into an `ACTION_NOT_ALLOWED` tool
+response whose details carry `reason_code: resource_remediation_locked` and a
+`policy_boundary` telling the model to report the block and that it is cleared
+from the resource's Operator overrides. This is a courtesy refusal when the
+state can be read, not the safety gate: the lifecycle's dispatch gate stays
+authoritative and refuses even a human-approved plan once the lock is stored (a
+lock saved while a human dispatch is being admitted is a known narrow race that
+the lifecycle owns), an operator state that
+cannot be read at planning is not a refusal (planning executes nothing and
+dispatch re-checks), and REST and Patrol planning still go through the
+unchanged lifecycle planner. The block applies to typed actions that target the
+exact locked resource, not its host, its descendants or read-only investigation.
+The Assistant has no guest allowlist or denylist of its own: the per-resource
+lock is the single place an operator tells Pulse not to act. The former
+`protected_guests` AI setting was saved and pushed into the tool executor but
+read only by an unreachable handler, so it never constrained `pulse_control`.
+It is removed from the AI settings projection, the tool executor and the
+Settings panel; `PUT /api/settings/ai/update` ignores the field from older
+clients, and a stored value is dropped the next time the settings are written.
+
`pulse_query action=action` reads an exact action ID from the tenant-pinned
canonical audit. It retains the full plan, recorded decisions, origin and
canonical `ActionResultV2`, including independent observer identity and timestamps.
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index c109654346..ff3ea05564 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -34,10 +34,11 @@ through Assistant condensation. Performance responses add a guest-history source
limitation without relabelling past samples or changing their numbers; their
actual tool controls are in `TestGuestMemoryHistoryDoesNotBorrowLiveOrigin`.
-The retained `protected_guests` settings field is legacy compatibility data,
-not an exclusion filter for canonical saved action plans. Existing Assistant
-help now states that limitation and requires target/approval review in Actions.
-No field value, GET/PUT shape, scope or approval authority changes.
+The `protected_guests` settings field is retired: it was never an exclusion
+filter for canonical saved action plans. `GET /api/settings/ai` no longer
+returns it, `PUT /api/settings/ai/update` ignores it from older clients, and a
+stored value is dropped the next time the settings are written. Scope and
+approval authority do not change.
A legacy client echoing the projected `controlled` mode into an unrelated AI
settings PUT must retain a stored `autonomous` preference and its existing
@@ -52,8 +53,7 @@ legacy `autonomous` preference presents planning for operator review, never
unprompted execution. Existing legacy PUT validation and `ai_autofix` checks
remain; an entitled old client can retain the stored preference, an unentitled
request is refused. Unrelated saves do not rewrite it. Shared external-agent
-vocabulary, Patrol settings, protected-guest arrays and authenticated authority
-remain unchanged. `TestContract_AssistantSettingsAdvertisePlanningNotExecution`
+vocabulary, Patrol settings and authenticated authority remain unchanged. `TestContract_AssistantSettingsAdvertisePlanningNotExecution`
and the actual persistence/handler tests pin responses and compatibility.
### Optional held-alert breach date consumer
@@ -1761,7 +1761,11 @@ payload shape change when the portal presents compact client rows.
contract tests rather than adding an untyped browser-only provider list.
API responses must never echo provider secret values; settings updates may
accept credential and clear-key fields, persist trimmed values, and return
- only configured state.
+ only configured state. The settings projection and update request carry no
+ `protected_guests` field: the Assistant has no guest list of its own, and a
+ `protected_guests` key from an older client is ignored. Guests Pulse must
+ not act on are locked through the resource operator state
+ (`neverAutoRemediate`), which the Assistant honours at planning.
6. `frontend-modern/src/api/aiChat.ts` shared with `ai-runtime`: the Assistant chat frontend client is both the first-party Assistant transport surface and a canonical API payload contract boundary.
7. `frontend-modern/src/api/generated/agentCapabilities.ts` shared with `ai-runtime`: the generated agent capabilities frontend types are both the Pulse Intelligence manifest TypeScript projection and a canonical API payload contract boundary.
8. `frontend-modern/src/api/nodes.ts` shared with `agent-lifecycle`: the shared Proxmox node client is both an agent lifecycle setup/install control surface and a canonical API payload contract boundary.
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 351562de65..efcb5c0e7d 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -30,9 +30,9 @@ The two-option Chat menu keeps radio semantics, keyboard cycling/Escape/focus
and saved-error recovery. Copy explains infrastructure plans in Actions and
separate Patrol authority; it does not grant approval or execution. Existing
scoped resource/alert/Patrol briefings and compact layouts remain intact.
-The retained Protected guests (legacy) field has an accessible description
-explicitly stating that it does not exclude saved action plans. Its saved list
-is not erased or presented as an execution safeguard. The Chat control menu
+The panel has no Protected guests field: it never excluded a saved action plan,
+so it was removed, and a muted line points operators at the resource's Never
+auto-remediate lock instead (`ai-never-auto-remediate-hint`). The Chat control menu
clamps to the composer and viewport on open and closes on viewport resize,
so a wrapped toolbar does not clip either option. Mounted geometry checks
and real 390px/320px browser bounds cover this observed gap.
@@ -3846,7 +3846,10 @@ production table, router and styles; it does not qualify full-app scrolling.
Patrol autonomy distinct from Assistant chat actions: Patrol's
hands-on control level belongs on the Patrol page, while the shared settings
shell may only describe whether Assistant chat can run eligible chat
- actions.
+ actions. The panel carries no per-guest allowlist or denylist: guests the
+ Assistant must not touch are locked with Never auto-remediate in the
+ resource's Operator overrides, and `AIRuntimeControlsSection.tsx` points
+ there instead of storing a separate Protected guests list.
11. Keep first-session dashboard empty-state copy on
`frontend-modern/src/utils/workloadEmptyStatePresentation.ts`, and make
infrastructure setup guidance name the canonical destination explicitly
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 34d4e0d1c7..a2f3817c6c 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -32,9 +32,9 @@ then checks explicit read-only opt-out and later opt-in remain possible.
The AI settings control projection describes read/query or plans for review in
Actions. It does not authorise a backup, restore, replay or data change; action
approval/run and independent verification remain separate. Stored legacy
-preferences, recovery-point access, the legacy protected-guests value and
-Patrol policy are preserved. The latter guest list is not a canonical saved-
-plan exclusion or a recovery execution safeguard. The handler change adds no recovery endpoint or execution route.
+preferences, recovery-point access and Patrol policy are preserved. The retired
+Protected guests list was never a canonical saved-plan exclusion or a recovery
+execution safeguard. The handler change adds no recovery endpoint or execution route.
### Retained guest identity cannot renew QGA eligibility
diff --git a/frontend-modern/browser-tests/assistant-control-compatibility.cjs b/frontend-modern/browser-tests/assistant-control-compatibility.cjs
index 776edc9a03..5af82f3743 100644
--- a/frontend-modern/browser-tests/assistant-control-compatibility.cjs
+++ b/frontend-modern/browser-tests/assistant-control-compatibility.cjs
@@ -67,7 +67,7 @@ const hash = (f) => crypto.createHash('sha256').update(fs.readFileSync(f)).diges
assert.equal(await select.locator('option').count(), 2);
const text = await page.locator('main').innerText();
assert.ok(!text.includes('chat-only') && !text.includes('Infrastructure changes stay with Patrol'));
- if (expected === 'controlled') { assert.ok(text.includes('Chat does not execute the plan')); const legacy = page.getByLabel('Protected guests (legacy)', { exact: true }); assert.equal(await legacy.inputValue(), 'vm-101'); assert.equal(await legacy.getAttribute('aria-describedby'), 'ai-protected-guests-help'); assert.ok(text.includes('This list does not exclude saved action plans.')); assert.ok(text.includes('Review each plan’s target and approval policy in Actions.')); }
+ if (expected === 'controlled') { assert.ok(text.includes('Chat does not execute the plan')); assert.equal(await page.getByLabel(/Protected guests/i).count(), 0); assert.ok(!text.includes('Protected guests')); const hint = page.getByTestId('ai-never-auto-remediate-hint'); assert.ok((await hint.innerText()).includes('Never auto-remediate')); assert.ok(!(await page.locator('input').evaluateAll((els) => els.some((el) => el.value === 'vm-101')))); }
else assert.ok(text.includes('Assistant can query and explain only. It cannot plan infrastructure actions.'));
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1));
});
@@ -136,7 +136,7 @@ const hash = (f) => crypto.createHash('sha256').update(fs.readFileSync(f)).diges
await page.getByRole('link', { name: link, exact: true }).click();
const h = page.getByRole('heading', { name: heading, exact: true }); await h.waitFor(); await h.scrollIntoViewIfNeeded();
const text = await page.locator('article').innerText(); assert.ok(text.includes('Assistant chat does not execute'));
- assert.ok(text.includes('stored') && text.includes('entitlement') && text.includes('independent verification') && text.includes('Protected guests (legacy)') && text.includes('does not exclude saved action plans'));
+ assert.ok(text.includes('stored') && text.includes('entitlement') && text.includes('independent verification') && text.includes('Never auto-remediate') && text.includes('has been removed'));
assert.ok(!text.includes('executes actions without prompting') && !text.includes('executes commands without prompting'));
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1));
await capture(state);
diff --git a/frontend-modern/browser-verification/31905b7de20127a4.json b/frontend-modern/browser-verification/31905b7de20127a4.json
new file mode 100644
index 0000000000..a3ab407d42
--- /dev/null
+++ b/frontend-modern/browser-verification/31905b7de20127a4.json
@@ -0,0 +1,43 @@
+{
+ "version": 1,
+ "base_sha": "410d84c69444ce4b59d00432b0b5510ce3016d0e",
+ "verified_at": "2026-10-10T06:32:00Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx",
+ "frontend-modern/src/components/Settings/useAISettingsState.ts",
+ "frontend-modern/src/types/ai.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx": "08088366e389facd9e43aa9aaffce757546a2252a84bf2f5a386fd3871f4eea5",
+ "frontend-modern/src/components/Settings/useAISettingsState.ts": "5bdff4f68c116aa9163f98fb1e5f19a126d6daec80953939c644cc762dbb9a64",
+ "frontend-modern/src/types/ai.ts": "ac585de10854c39abf4b2d4199fc90d5bf3ee85468163be66e11308f4150a55e"
+ },
+ "routes": [
+ "/settings/pulse-intelligence/assistant",
+ "/proxmox (web-prod inline drawer, Manage tab)"
+ ],
+ "viewports": [
+ {
+ "width": 1280,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "Settings > Assistant on a private non-mock stack whose saved AI config still carried protected_guests: the old field is gone, no input holds a saved value and the page text has no 'Protected guests'",
+ "Chat action mode Ask first shows the muted 'To keep Assistant away from a guest' line under the mode description; switching to Read-only hides it and switching back restores it",
+ "390px phone width: the line wraps inside the card (card 25-365px, line 42-348px) and the page has no horizontal overflow, at 1280px likewise",
+ "GET /api/settings/ai from the new backend carries no protected_guests key",
+ "web-prod drawer Manage tab shows Operator overrides with Never auto-remediate off, then the lock-confirmation prompt, then Save overrides; the Assistant then declines to plan a restart for it"
+ ],
+ "interactions": [
+ "Changed Chat action mode Read-only <-> Ask first and read the hint's presence",
+ "Clicked Save Assistant settings and captured the PUT body: model, discovery_enabled and discovery_interval_hours only, no protected_guests and no control_level",
+ "Opened the web-prod row, chose Manage, toggled Never auto-remediate, clicked Lock this resource, clicked Save overrides; operator-state API read back neverAutoRemediate true",
+ "Drove one Assistant turn through the real chat route with a stub provider emitting pulse_control restart for web-prod: refused with ACTION_NOT_ALLOWED / resource_remediation_locked and no action in Actions"
+ ]
+}
diff --git a/frontend-modern/public/docs/AI.md b/frontend-modern/public/docs/AI.md
index 084b114eac..daa739f3e4 100644
--- a/frontend-modern/public/docs/AI.md
+++ b/frontend-modern/public/docs/AI.md
@@ -487,9 +487,11 @@ Older saved `autonomous` preferences display as **Ask first**, not as permission
to execute without approval. The stored preference and its existing entitlement
checks are preserved for older clients.
-**Protected guests (legacy)** retains older VMIDs or names. This list does not
-exclude saved action plans. Review each plan’s target and approval policy in
-**Actions** instead of treating this list as an execution safeguard.
+To keep Assistant away from a specific guest, lock it: open the guest, choose
+**Manage**, turn on **Never auto-remediate** under Operator overrides, and save.
+Pulse then refuses typed actions that target that resource, including
+approved ones. Older versions also showed a **Protected guests** list here. It
+never excluded a guest from action plans, so it has been removed.
### Reviewing an Assistant action plan
diff --git a/frontend-modern/public/docs/AI_AUTONOMY.md b/frontend-modern/public/docs/AI_AUTONOMY.md
index e090c6931e..d5f28ddb05 100644
--- a/frontend-modern/public/docs/AI_AUTONOMY.md
+++ b/frontend-modern/public/docs/AI_AUTONOMY.md
@@ -109,9 +109,12 @@ entitlement checks for older clients. It does not bypass approval. An unrelated
settings save does not rewrite that preference. Unknown values fail closed to
read-only. Patrol mode and Autopilot acknowledgements remain separate.
-**Protected guests (legacy)** retains older VMIDs or names. This list does not
-exclude saved action plans. Review each plan’s target and approval policy in
-**Actions** instead of treating this list as an execution safeguard.
+To keep Assistant away from a specific guest, lock it: open the guest, choose
+**Manage**, turn on **Never auto-remediate** under Operator overrides, and save.
+Pulse then refuses typed actions that target that resource, including
+approved ones (see [Keep a Resource Off-Limits](#keep-a-resource-off-limits)).
+Older versions also showed a **Protected guests** list here. It never excluded a
+guest from action plans, so it has been removed.
### Configuration
@@ -189,6 +192,10 @@ The assistant cannot operate on resources it hasn't first discovered. This preve
After executing any control action, the assistant must verify the result with a read operation before reporting success. This is enforced by the FSM — the assistant cannot return to idle state without verification.
+### Keep a Resource Off-Limits
+
+To stop Pulse acting on a specific guest, host or container, open its drawer, choose **Manage**, turn on **Never auto-remediate** under Operator overrides, confirm the prompt, and click **Save overrides**. Pulse then refuses typed actions that target that exact resource: the Assistant declines to plan one when it can read the lock, Patrol will not run one, and the action lifecycle checks the lock again before it runs an action that was already planned, even when approved. The lock covers that resource only, not its host or other resources, and it does not stop read-only investigation. Turn it off and save again when you want Pulse to act on the resource again. A resource whose lifecycle is Retired is blocked the same way until the lifecycle is set back to Active.
+
---
## Recommended Progression
diff --git a/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx b/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
index 1a43a2f4eb..ea3805fc25 100644
--- a/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
+++ b/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
@@ -319,30 +319,13 @@ export const AIAssistantCommandAccessSection: Component<AIRuntimeControlsSection
{getAIControlLevelDescription(state.form.controlLevel)}
</p>
<Show when={state.form.controlLevel !== 'read_only'}>
- <div class="flex items-start gap-3 pt-2 border-t border-blue-200 dark:border-blue-700">
- <label
- for="ai-protected-guests"
- class="text-xs font-medium text-muted w-28 shrink-0 pt-1"
- >
- Protected guests (legacy)
- </label>
- <div class="flex-1">
- <input
- id="ai-protected-guests"
- aria-describedby="ai-protected-guests-help"
- type="text"
- value={state.form.protectedGuests}
- onInput={(e) => state.setForm('protectedGuests', e.currentTarget.value)}
- placeholder="e.g., 100, 101, prod-db"
- class="w-full min-h-10 sm:min-h-9 px-2 py-2 text-sm border border-border rounded-sm"
- disabled={state.saving()}
- />
- <p id="ai-protected-guests-help" class="text-[10px] text-muted mt-1">
- Retained legacy VMIDs or names. This list does not exclude saved action plans.
- Review each plan’s target and approval policy in Actions.
- </p>
- </div>
- </div>
+ <p
+ class="pt-2 border-t border-blue-200 dark:border-blue-700 text-[10px] text-muted"
+ data-testid="ai-never-auto-remediate-hint"
+ >
+ To keep Assistant away from a guest, open it, choose Manage, turn on Never
+ auto-remediate, and save. Pulse then refuses typed actions on that guest.
+ </p>
</Show>
</div>
</>
diff --git a/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx b/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
index 554ab60f21..25490661bd 100644
--- a/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
@@ -273,6 +273,39 @@ describe('AISettings model loading error states', () => {
);
});
+ it('points Assistant protection at the per-guest lock and never sends a protected guests list', async () => {
+ // An older backend may still echo the retired list; it must not surface or round-trip.
+ getSettingsMock.mockResolvedValue({
+ ...baseSettings(),
+ enabled: true,
+ configured: true,
+ control_level: 'controlled',
+ protected_guests: ['101', 'prod-db'],
+ });
+ updateSettingsMock.mockImplementation(async (payload: Record<string, unknown>) => ({
+ ...baseSettings(),
+ enabled: true,
+ configured: true,
+ ...payload,
+ }));
+
+ renderComponent('assistant');
+
+ const hint = await screen.findByTestId('ai-never-auto-remediate-hint');
+ expect(hint).toHaveTextContent('Never auto-remediate');
+ expect(screen.queryByLabelText(/Protected guests/i)).not.toBeInTheDocument();
+ expect(screen.queryByDisplayValue('101, prod-db')).not.toBeInTheDocument();
+
+ fireEvent.change(screen.getByLabelText('Chat action mode'), { target: { value: 'read_only' } });
+ expect(screen.queryByTestId('ai-never-auto-remediate-hint')).not.toBeInTheDocument();
+
+ fireEvent.click(screen.getByRole('button', { name: /Save Assistant settings/i }));
+ await waitFor(() => {
+ expect(updateSettingsMock).toHaveBeenCalledTimes(1);
+ });
+ expect(updateSettingsMock.mock.calls[0][0]).not.toHaveProperty('protected_guests');
+ });
+
it('keeps Provider & Models focused on provider setup and runtime cost controls', async () => {
getSettingsMock.mockResolvedValue({
...baseSettings(),
@@ -920,7 +953,6 @@ describe('Assistant saved-control compatibility', () => {
const saved = {
...baseSettings(),
control_level: level,
- protected_guests: ['vm-101'],
patrol_autonomy_level: 'full',
};
getSettingsMock.mockResolvedValue(saved);
@@ -941,26 +973,8 @@ describe('Assistant saved-control compatibility', () => {
},
);
- it('explains the legacy protected list does not exclude canonical action plans', async () => {
- getSettingsMock.mockResolvedValue({
- ...baseSettings(),
- control_level: 'autonomous',
- protected_guests: ['101', 'prod-db'],
- });
- renderComponent('assistant');
- const legacy = await screen.findByLabelText('Protected guests (legacy)');
- await waitFor(() => expect(legacy).toHaveValue('101, prod-db'));
- expect(legacy).toHaveAccessibleDescription(
- 'Retained legacy VMIDs or names. This list does not exclude saved action plans. Review each plan’s target and approval policy in Actions.',
- );
- expect(screen.queryByText(/excluded from Assistant action planning/i)).not.toBeInTheDocument();
- fireEvent.click(screen.getByRole('button', { name: /Save Assistant settings/i }));
- await waitFor(() => expect(updateSettingsMock).toHaveBeenCalledTimes(1));
- expect(updateSettingsMock.mock.calls[0][0]).not.toHaveProperty('protected_guests');
- });
-
it('explicitly opts out of legacy action planning without changing Patrol', async () => {
- const saved = { ...baseSettings(), control_level: 'autonomous', protected_guests: ['vm-101'] };
+ const saved = { ...baseSettings(), control_level: 'autonomous' };
getSettingsMock.mockResolvedValue(saved);
updateSettingsMock.mockImplementation(async (payload: Record<string, unknown>) => ({
...saved,
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index e28ace1275..95d7e08e7d 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -117,14 +117,11 @@ const settingsRuntimeSources = import.meta.glob(['../*.tsx', '../ConnectionEdito
}) as Record<string, string>;
describe('settings architecture guardrails', () => {
- it('pairs the legacy protected field with its accessible canonical-plan limitation', () => {
- expect(aiRuntimeControlsSectionSource).toContain('Protected guests (legacy)');
- expect(aiRuntimeControlsSectionSource).toContain('aria-describedby="ai-protected-guests-help"');
- expect(aiRuntimeControlsSectionSource).toContain('id="ai-protected-guests-help"');
- expect(aiRuntimeControlsSectionSource).toContain(
- 'This list does not exclude saved action plans.',
- );
- expect(aiRuntimeControlsSectionSource).not.toContain('excluded from Assistant action planning');
+ it('points Assistant protection at the per-resource lock instead of a protected guests list', () => {
+ expect(aiRuntimeControlsSectionSource).toContain('data-testid="ai-never-auto-remediate-hint"');
+ expect(aiRuntimeControlsSectionSource).toContain('turn on Never');
+ expect(aiRuntimeControlsSectionSource).not.toMatch(/protected.?guests/i);
+ expect(aiSettingsStateSource).not.toMatch(/protected.?guests/i);
});
it('keeps the Patrol cost preview on the canonical cost-preview API and presentation helper', () => {
diff --git a/frontend-modern/src/components/Settings/useAISettingsState.ts b/frontend-modern/src/components/Settings/useAISettingsState.ts
index 27d1112b70..adcd489907 100644
--- a/frontend-modern/src/components/Settings/useAISettingsState.ts
+++ b/frontend-modern/src/components/Settings/useAISettingsState.ts
@@ -416,7 +416,6 @@ export const useAISettingsState = (options: AISettingsStateOptions = {}) => {
costBudgetUSD30d: '',
requestTimeoutSeconds: 300,
controlLevel: 'read_only' as AIControlLevel,
- protectedGuests: '' as string,
discoveryEnabled: false,
discoveryIntervalHours: 0,
});
@@ -519,7 +518,6 @@ export const useAISettingsState = (options: AISettingsStateOptions = {}) => {
costBudgetUSD30d: '',
requestTimeoutSeconds: 300,
controlLevel: 'read_only',
- protectedGuests: '',
discoveryEnabled: false,
discoveryIntervalHours: 0,
});
@@ -573,7 +571,6 @@ export const useAISettingsState = (options: AISettingsStateOptions = {}) => {
: '',
requestTimeoutSeconds: data.request_timeout_seconds ?? 300,
controlLevel: normalizeAIControlLevel(data.control_level),
- protectedGuests: Array.isArray(data.protected_guests) ? data.protected_guests.join(', ') : '',
discoveryEnabled: data.discovery_enabled ?? false,
discoveryIntervalHours: data.discovery_interval_hours ?? 0,
});
@@ -1208,18 +1205,6 @@ export const useAISettingsState = (options: AISettingsStateOptions = {}) => {
payload.control_level = form.controlLevel;
}
- const currentProtected = settings()?.protected_guests || [];
- const newProtected = form.protectedGuests
- .split(',')
- .map((value: string) => value.trim())
- .filter((value: string) => value.length > 0);
- const protectedChanged =
- newProtected.length !== currentProtected.length ||
- newProtected.some((guest: string, index: number) => guest !== currentProtected[index]);
- if (protectedChanged) {
- payload.protected_guests = newProtected;
- }
-
payload.discovery_enabled = form.discoveryEnabled;
payload.discovery_interval_hours = form.discoveryIntervalHours;
diff --git a/frontend-modern/src/types/ai.ts b/frontend-modern/src/types/ai.ts
index a44bd74e78..e37327f362 100644
--- a/frontend-modern/src/types/ai.ts
+++ b/frontend-modern/src/types/ai.ts
@@ -130,7 +130,6 @@ export interface AISettings {
// Infrastructure control settings
control_level?: 'read_only' | 'controlled' | 'autonomous';
- protected_guests?: string[];
// AI Discovery settings
discovery_enabled?: boolean;
@@ -286,7 +285,6 @@ export interface AISettingsUpdateRequest {
// Infrastructure control settings
control_level?: 'read_only' | 'controlled' | 'autonomous';
- protected_guests?: string[];
// AI Discovery settings
discovery_enabled?: boolean;
diff --git a/internal/ai/chat/service.go b/internal/ai/chat/service.go
index aa2a7ec111..330d80fe6d 100644
--- a/internal/ai/chat/service.go
+++ b/internal/ai/chat/service.go
@@ -176,7 +176,6 @@ func NewService(cfg Config) *Service {
if cfg.AIConfig != nil {
execCfg.ControlLevel = resolveEffectiveControlLevel(cfg.ControlLevelResolver, cfg.AIConfig)
- execCfg.ProtectedGuests = cfg.AIConfig.GetProtectedGuests()
}
executor := tools.NewPulseToolExecutor(execCfg)
@@ -562,7 +561,6 @@ func (s *Service) Restart(ctx context.Context, newCfg *config.AIConfig) error {
// Update executor settings
if s.executor != nil && s.cfg != nil {
s.executor.SetControlLevel(s.effectiveControlLevelLocked())
- s.executor.SetProtectedGuests(s.cfg.GetProtectedGuests())
}
// Recreate provider with new settings
@@ -3687,7 +3685,6 @@ func (s *Service) UpdateControlSettings(cfg *config.AIConfig) {
s.cfg = cfg
if s.executor != nil {
s.executor.SetControlLevel(s.effectiveControlLevelLocked())
- s.executor.SetProtectedGuests(cfg.GetProtectedGuests())
}
}
diff --git a/internal/ai/chat/service_test.go b/internal/ai/chat/service_test.go
index d5b995b979..81740e5eda 100644
--- a/internal/ai/chat/service_test.go
+++ b/internal/ai/chat/service_test.go
@@ -617,8 +617,7 @@ func TestService_SettersAndUpdateControlSettings(t *testing.T) {
service.UpdateControlSettings(nil)
service.UpdateControlSettings(&config.AIConfig{
- ControlLevel: config.ControlLevelControlled,
- ProtectedGuests: []string{"101"},
+ ControlLevel: config.ControlLevelControlled,
})
// After updating to controlled mode, pulse_control should be available
diff --git a/internal/ai/chat/service_tooling_test.go b/internal/ai/chat/service_tooling_test.go
index a10af4e225..75d9fb2de3 100644
--- a/internal/ai/chat/service_tooling_test.go
+++ b/internal/ai/chat/service_tooling_test.go
@@ -1414,7 +1414,7 @@ func TestAssistantRuntimeProjectsLegacyLevelAfterResolver(t *testing.T) {
for _, saved := range []string{config.ControlLevelReadOnly, config.ControlLevelControlled, config.ControlLevelAutonomous, "unknown"} {
for _, resolved := range []string{"", config.ControlLevelReadOnly, config.ControlLevelControlled, config.ControlLevelAutonomous} {
t.Run(saved+"/resolver-"+resolved, func(t *testing.T) {
- cfg := &config.AIConfig{ControlLevel: saved, ProtectedGuests: []string{"vm-101"}}
+ cfg := &config.AIConfig{ControlLevel: saved}
var resolver func(*config.AIConfig) string
if resolved != "" {
resolver = func(*config.AIConfig) string { return resolved }
diff --git a/internal/ai/tools/control_targets.go b/internal/ai/tools/control_targets.go
index 6c1de6153f..c0a67d327f 100644
--- a/internal/ai/tools/control_targets.go
+++ b/internal/ai/tools/control_targets.go
@@ -349,14 +349,37 @@ func ambiguousControlTargetResult(ref, action string, candidates []unifiedresour
))
}
+// controlLockedResult is the tool evidence for a target whose operator state
+// blocks all remediation (Never auto-remediate, or a retired lifecycle). The
+// block is the operator's explicit "Pulse must not act on this resource"
+// decision, so the model is told to report it and not to look for another way
+// to act.
+func controlLockedResult(target controlTarget, action string) CallToolResult {
+ name := target.displayName()
+ return NewToolResponseResult(NewToolBlockedError(
+ agentcapabilities.ErrCodeActionNotAllowed,
+ fmt.Sprintf("%q is not permitted on %s: an operator blocked all remediation for this resource (Never auto-remediate is on, or its lifecycle is Retired), so Pulse will not run any action on it.", action, name),
+ map[string]interface{}{
+ "resource_id": target.canonicalID(),
+ "requested_action": action,
+ "reason_code": agentcapabilities.AgentErrCodeResourceRemediationLocked,
+ "policy_boundary": "An operator blocked all remediation for this resource, even with approval. Report exactly this boundary. It is cleared from the resource's Operator overrides in Pulse: turn off Never auto-remediate and, if the lifecycle is Retired, set it back to Active, then save. Do not plan the action another way or suggest workarounds.",
+ },
+ ))
+}
+
// controlPlanFailureResult turns a planning error into tool evidence the model
-// can report faithfully. A capability the resource does not advertise is a
-// real boundary and is described with the resource's current capability list;
-// anything else is passed through unchanged.
+// can report faithfully. An operator remediation block and a capability the
+// resource does not advertise are real boundaries and are described as such
+// (the latter with the resource's current capability list); anything else is
+// passed through unchanged.
func controlPlanFailureResult(target controlTarget, action string, err error) CallToolResult {
if err == nil {
return NewErrorResult(fmt.Errorf("canonical action planning failed"))
}
+ if errors.Is(err, unifiedresources.ErrResourceRemediationLocked) {
+ return controlLockedResult(target, action)
+ }
if !errors.Is(err, actionplanner.ErrCapabilityNotFound) {
return NewErrorResult(err)
}
diff --git a/internal/ai/tools/data_types.go b/internal/ai/tools/data_types.go
index 368e8354b9..5897911a1d 100644
--- a/internal/ai/tools/data_types.go
+++ b/internal/ai/tools/data_types.go
@@ -121,7 +121,6 @@ type AgentInfo struct {
type CapabilitiesResponse struct {
ControlLevel string `json:"control_level"`
Features FeatureFlags `json:"features"`
- ProtectedGuests []string `json:"protected_guests"`
ConnectedAgents int `json:"connected_agents"`
Agents []AgentInfo `json:"agents"` // List of connected agents with hostnames
Version string `json:"version"`
@@ -132,9 +131,6 @@ func EmptyCapabilitiesResponse() CapabilitiesResponse {
}
func (r CapabilitiesResponse) NormalizeCollections() CapabilitiesResponse {
- if r.ProtectedGuests == nil {
- r.ProtectedGuests = []string{}
- }
if r.Agents == nil {
r.Agents = []AgentInfo{}
}
diff --git a/internal/ai/tools/executor.go b/internal/ai/tools/executor.go
index 22e13678af..0ea4785066 100644
--- a/internal/ai/tools/executor.go
+++ b/internal/ai/tools/executor.go
@@ -577,9 +577,8 @@ type ExecutorConfig struct {
ReadState unifiedresources.ReadState
// Control settings
- ControlLevel ControlLevel
- ProtectedGuests []string // VMIDs that AI cannot control
- OrgID string // Tenant/org scope for approval records
+ ControlLevel ControlLevel
+ OrgID string // Tenant/org scope for approval records
// Optional report-narration providers, used by the pulse_summarize
// tool to produce AI-narrated synthesis in chat. When the per-tenant
@@ -652,8 +651,7 @@ type PulseToolExecutor struct {
readState unifiedresources.ReadState
// Control settings
- controlLevel ControlLevel
- protectedGuests []string
+ controlLevel ControlLevel
// Current execution context
targetType string
@@ -757,7 +755,6 @@ func NewPulseToolExecutor(cfg ExecutorConfig) *PulseToolExecutor {
typedActionPlanner: cfg.TypedActionPlanner,
readState: cfg.ReadState,
controlLevel: cfg.ControlLevel,
- protectedGuests: cfg.ProtectedGuests,
orgID: normalizeExecutorOrgID(cfg.OrgID),
reportNarrator: cfg.ReportNarrator,
reportFleetNarrator: cfg.ReportFleetNarrator,
@@ -834,7 +831,6 @@ func (e *PulseToolExecutor) Clone() *PulseToolExecutor {
typedActionPlanner: e.typedActionPlanner,
readState: e.readState,
controlLevel: e.controlLevel,
- protectedGuests: append([]string(nil), e.protectedGuests...),
targetType: e.targetType,
targetID: e.targetID,
isAutonomous: e.isAutonomous,
@@ -932,11 +928,6 @@ func (e *PulseToolExecutor) SetExecuteAuthority(allowed bool) {
e.executeAuthorityBound = true
}
-// SetProtectedGuests updates the protected guests list
-func (e *PulseToolExecutor) SetProtectedGuests(vmids []string) {
- e.protectedGuests = vmids
-}
-
// RegisterTool allows tests or extensions to add tools at runtime.
func (e *PulseToolExecutor) RegisterTool(tool RegisteredTool) {
e.registry.RegisterExtension(tool)
diff --git a/internal/ai/tools/executor_clone_test.go b/internal/ai/tools/executor_clone_test.go
index 9da0970100..dbe459c02d 100644
--- a/internal/ai/tools/executor_clone_test.go
+++ b/internal/ai/tools/executor_clone_test.go
@@ -13,7 +13,6 @@ func TestPulseToolExecutorCloneIsolatesSessionState(t *testing.T) {
original.SetResolvedContext(resolved)
original.SetPatrolFindingCreator(creator)
original.SetPatrolObserverProposer(proposer)
- original.protectedGuests = []string{"101"}
clone := original.Clone()
if clone == nil {
@@ -42,11 +41,6 @@ func TestPulseToolExecutorCloneIsolatesSessionState(t *testing.T) {
if original.targetType != "node" || original.targetID != "node-1" || original.isAutonomous {
t.Fatalf("original context mutated after clone update: got %q/%q/%v", original.targetType, original.targetID, original.isAutonomous)
}
-
- clone.protectedGuests[0] = "999"
- if original.protectedGuests[0] != "101" {
- t.Fatalf("protectedGuests slice is shared between clone and original: got %q", original.protectedGuests[0])
- }
}
func TestPulseToolExecutorCloneDoesNotSharePatrolCreatorSlot(t *testing.T) {
diff --git a/internal/ai/tools/executor_setters_test.go b/internal/ai/tools/executor_setters_test.go
index 441dcbea10..b78ff3b46d 100644
--- a/internal/ai/tools/executor_setters_test.go
+++ b/internal/ai/tools/executor_setters_test.go
@@ -49,9 +49,6 @@ func TestPulseToolExecutor_Setters(t *testing.T) {
exec.SetControlLevel(ControlLevelControlled)
assert.Equal(t, ControlLevelControlled, exec.controlLevel)
- exec.SetProtectedGuests([]string{"100", "101"})
- assert.Equal(t, []string{"100", "101"}, exec.protectedGuests)
-
metadataUpdater := &stubMetadataUpdater{}
exec.SetMetadataUpdater(metadataUpdater)
assert.Equal(t, metadataUpdater, exec.metadataUpdater)
diff --git a/internal/ai/tools/infrastructure_low_coverage_test.go b/internal/ai/tools/infrastructure_low_coverage_test.go
index 736eb58d16..2f18fc85cf 100644
--- a/internal/ai/tools/infrastructure_low_coverage_test.go
+++ b/internal/ai/tools/infrastructure_low_coverage_test.go
@@ -445,7 +445,7 @@ func TestSharedToolSummaryOwnersUseCanonicalEmptyCollections(t *testing.T) {
raw any
keys []string
}{
- {name: "capabilities", raw: EmptyCapabilitiesResponse(), keys: []string{"protected_guests", "agents"}},
+ {name: "capabilities", raw: EmptyCapabilitiesResponse(), keys: []string{"agents"}},
{name: "agent_scope", raw: EmptyAgentScopeResponse(), keys: []string{"settings", "observed_modules"}},
{name: "cluster_status", raw: EmptyClusterStatusResponse(), keys: []string{"clusters"}},
{name: "recent_tasks", raw: EmptyRecentTasksResponse(), keys: []string{"tasks"}},
diff --git a/internal/ai/tools/tools_control.go b/internal/ai/tools/tools_control.go
index afb1eac34e..af349f326b 100644
--- a/internal/ai/tools/tools_control.go
+++ b/internal/ai/tools/tools_control.go
@@ -516,14 +516,6 @@ func (e *PulseToolExecutor) executeControlGuest(ctx context.Context, args map[st
return NewErrorResult(fmt.Errorf("could not find guest '%s': %v", guestID, err)), nil
}
- // Check if guest is protected
- vmidStr := fmt.Sprintf("%d", guest.VMID)
- for _, protected := range e.protectedGuests {
- if protected == vmidStr || protected == guest.Name {
- return NewErrorResult(fmt.Errorf("guest %s (VMID %d) is protected and cannot be controlled by Pulse Assistant", guest.Name, guest.VMID)), nil
- }
- }
-
// Build the command
cmdTool := "pct"
if guest.Type == "vm" {
diff --git a/internal/api/ai_handlers.go b/internal/api/ai_handlers.go
index f05affd4b5..c16bbbac9d 100644
--- a/internal/api/ai_handlers.go
+++ b/internal/api/ai_handlers.go
@@ -59,7 +59,7 @@ type AISettingsHandler struct {
aiServicesMu sync.RWMutex
agentServer *agentexec.Server
onModelChange func() // Called when model or other AI chat-affecting settings change
- onControlSettingsChange func() // Called when control level or protected guests change
+ onControlSettingsChange func() // Called when the control level changes
// Providers to be applied to new services
stateProvider ai.StateProvider
@@ -2341,8 +2341,7 @@ type AISettingsResponse struct {
// Request timeout (seconds) - for slow hardware running local models
RequestTimeoutSeconds int `json:"request_timeout_seconds,omitempty"`
// Infrastructure control settings
- ControlLevel string `json:"control_level"` // "read_only" or "controlled" (interactive projection)
- ProtectedGuests []string `json:"protected_guests"` // VMIDs/names that AI cannot control
+ ControlLevel string `json:"control_level"` // "read_only" or "controlled" (interactive projection)
// Discovery settings
DiscoveryEnabled bool `json:"discovery_enabled"` // true if discovery is enabled
DiscoveryIntervalHours int `json:"discovery_interval_hours,omitempty"` // Hours between auto-scans (0 = manual only)
@@ -2425,9 +2424,6 @@ func (r AISettingsResponse) NormalizeCollections() AISettingsResponse {
if r.Providers == nil {
r.Providers = []AIProviderDefinitionResponse{}
}
- if r.ProtectedGuests == nil {
- r.ProtectedGuests = []string{}
- }
if r.PatrolAlertTriggerTypes == nil {
r.PatrolAlertTriggerTypes = []string{}
}
@@ -2537,8 +2533,7 @@ type AISettingsUpdateRequest struct {
// Request timeout (seconds) - for slow hardware running local models
RequestTimeoutSeconds *int `json:"request_timeout_seconds,omitempty"`
// Infrastructure control settings
- ControlLevel *string `json:"control_level,omitempty"` // "read_only", "controlled", "autonomous"
- ProtectedGuests []string `json:"protected_guests,omitempty"` // VMIDs/names that AI cannot control (nil = don't update, empty = clear)
+ ControlLevel *string `json:"control_level,omitempty"` // "read_only", "controlled", "autonomous"
// Discovery settings
DiscoveryEnabled *bool `json:"discovery_enabled,omitempty"` // Enable discovery
DiscoveryIntervalHours *int `json:"discovery_interval_hours,omitempty"` // Hours between auto-scans (0 = manual only)
@@ -2678,7 +2673,6 @@ func (h *AISettingsHandler) HandleGetAISettings(w http.ResponseWriter, r *http.R
CostBudgetUSD30d: settings.CostBudgetUSD30d,
RequestTimeoutSeconds: settings.RequestTimeoutSeconds,
ControlLevel: settings.GetAssistantControlLevel(hasAutoFixFeature),
- ProtectedGuests: settings.GetProtectedGuests(),
DiscoveryEnabled: settings.IsDiscoveryEnabled(),
DiscoveryIntervalHours: settings.DiscoveryIntervalHours,
PatrolPreflight: cachedPatrolPreflightSnapshot(aiService),
@@ -3077,11 +3071,6 @@ func (h *AISettingsHandler) HandleUpdateAISettings(w http.ResponseWriter, r *htt
}
}
- // Handle protected guests (nil = don't update)
- if req.ProtectedGuests != nil {
- settings.ProtectedGuests = req.ProtectedGuests
- }
-
// Handle discovery settings
if req.DiscoveryEnabled != nil {
settings.DiscoveryEnabled = *req.DiscoveryEnabled
@@ -3158,9 +3147,9 @@ func (h *AISettingsHandler) HandleUpdateAISettings(w http.ResponseWriter, r *htt
h.onModelChange()
}
- // Update Assistant control settings if control level or protected guests changed.
+ // Update Assistant control settings if the control level changed.
// This updates tool visibility without restarting AI chat.
- if h.onControlSettingsChange != nil && (req.ControlLevel != nil || req.ProtectedGuests != nil) {
+ if h.onControlSettingsChange != nil && req.ControlLevel != nil {
h.onControlSettingsChange()
}
@@ -3237,7 +3226,6 @@ func (h *AISettingsHandler) HandleUpdateAISettings(w http.ResponseWriter, r *htt
Providers: aiProviderDefinitionResponses(settings),
RequestTimeoutSeconds: settings.RequestTimeoutSeconds,
ControlLevel: settings.GetAssistantControlLevel(hasAutoFixFeature),
- ProtectedGuests: settings.GetProtectedGuests(),
DiscoveryEnabled: settings.DiscoveryEnabled,
DiscoveryIntervalHours: settings.DiscoveryIntervalHours,
PatrolReadiness: ptrToPatrolReadiness(patrolReadiness),
diff --git a/internal/api/ai_handlers_test.go b/internal/api/ai_handlers_test.go
index 77e51219c9..dc0591460a 100644
--- a/internal/api/ai_handlers_test.go
+++ b/internal/api/ai_handlers_test.go
@@ -511,21 +511,20 @@ func TestAISettingsHandler_UpdateSettingsRefreshesAssistantToolVisibilityForCont
require.Equal(t, http.StatusOK, controlRec.Code, controlRec.Body.String())
require.Equal(t, 1, controlRefreshes, "control level changes must refresh Assistant tool visibility")
- protectedBody, err := json.Marshal(AISettingsUpdateRequest{
- ProtectedGuests: []string{"vm-101"},
- })
- require.NoError(t, err)
- protectedReq := newLoopbackRequest(http.MethodPut, "/api/settings/ai/update", bytes.NewReader(protectedBody))
- protectedRec := httptest.NewRecorder()
- handler.HandleUpdateAISettings(protectedRec, protectedReq)
+ // The retired Protected guests field is tolerated from older clients and
+ // scripts, but it is not a setting any more: it changes nothing and does not
+ // refresh Assistant tool visibility.
+ staleReq := newLoopbackRequest(http.MethodPut, "/api/settings/ai/update", strings.NewReader(`{"protected_guests":["vm-101"]}`))
+ staleRec := httptest.NewRecorder()
+ handler.HandleUpdateAISettings(staleRec, staleReq)
- require.Equal(t, http.StatusOK, protectedRec.Code, protectedRec.Body.String())
- require.Equal(t, 2, controlRefreshes, "protected guest changes must refresh Assistant tool visibility")
+ require.Equal(t, http.StatusOK, staleRec.Code, staleRec.Body.String())
+ require.Equal(t, 1, controlRefreshes, "the retired protected_guests field must not refresh Assistant tool visibility")
+ require.NotContains(t, staleRec.Body.String(), "protected_guests")
persisted, err := persistence.LoadAIConfig()
require.NoError(t, err)
require.Equal(t, config.ControlLevelControlled, persisted.GetControlLevel())
- require.Equal(t, []string{"vm-101"}, persisted.GetProtectedGuests())
}
func TestAISettingsHandler_PatrolReadinessBranches(t *testing.T) {
@@ -758,8 +757,7 @@ func TestAISettingsHandler_GetAndUpdateSettings_RoundTrip(t *testing.T) {
}
responseBody := rec.Body.String()
if !strings.Contains(responseBody, `"available_models":[]`) ||
- !strings.Contains(responseBody, `"configured_providers":[]`) ||
- !strings.Contains(responseBody, `"protected_guests":[]`) {
+ !strings.Contains(responseBody, `"configured_providers":[]`) {
t.Fatalf("expected AI settings response collections in JSON body, got %s", responseBody)
}
}
@@ -804,8 +802,7 @@ func TestAISettingsHandler_GetAndUpdateSettings_RoundTrip(t *testing.T) {
}
responseBody := rec.Body.String()
if !strings.Contains(responseBody, `"available_models":[]`) ||
- !strings.Contains(responseBody, `"configured_providers":[`) ||
- !strings.Contains(responseBody, `"protected_guests":[]`) {
+ !strings.Contains(responseBody, `"configured_providers":[`) {
t.Fatalf("expected AI settings response collections in JSON body, got %s", responseBody)
}
}
@@ -835,8 +832,7 @@ func TestAISettingsHandler_GetAndUpdateSettings_RoundTrip(t *testing.T) {
}
responseBody := rec.Body.String()
if !strings.Contains(responseBody, `"available_models":[]`) ||
- !strings.Contains(responseBody, `"configured_providers":[`) ||
- !strings.Contains(responseBody, `"protected_guests":[]`) {
+ !strings.Contains(responseBody, `"configured_providers":[`) {
t.Fatalf("expected AI settings response collections in JSON body, got %s", responseBody)
}
}
@@ -1116,8 +1112,8 @@ func TestAISettingsResponse_UsesCanonicalEmptyCollections(t *testing.T) {
if !strings.Contains(string(payload), `"configured_providers":[]`) {
t.Fatalf("expected empty AI settings response to retain configured_providers, got %s", payload)
}
- if !strings.Contains(string(payload), `"protected_guests":[]`) {
- t.Fatalf("expected empty AI settings response to retain protected_guests, got %s", payload)
+ if strings.Contains(string(payload), "protected_guests") {
+ t.Fatalf("AI settings response must not carry the retired protected_guests field, got %s", payload)
}
}
@@ -3831,7 +3827,6 @@ func TestAssistantSettingsProjectionAndUnrelatedSave(t *testing.T) {
persistence := config.NewConfigPersistence(tmp)
cfg := config.NewDefaultAIConfig()
cfg.ControlLevel = level
- cfg.ProtectedGuests = []string{"vm-101"}
cfg.PatrolAutonomyLevel = config.PatrolAutonomyFull
cfg.PatrolActionEmergencyStop = true
cfg.PatrolAutoFix = true
@@ -3862,7 +3857,6 @@ func TestAssistantSettingsProjectionAndUnrelatedSave(t *testing.T) {
wantStored = config.ControlLevelControlled
}
require.Equal(t, wantStored, persisted.ControlLevel, "unrelated save must preserve preference")
- require.Equal(t, []string{"vm-101"}, persisted.ProtectedGuests)
require.Equal(t, config.PatrolAutonomyFull, persisted.PatrolAutonomyLevel)
require.True(t, persisted.PatrolActionEmergencyStop)
require.True(t, persisted.PatrolAutoFix)
@@ -3880,7 +3874,6 @@ func TestAssistantLegacyClientUpdateKeepsEntitlementAndPreference(t *testing.T)
persistence := config.NewConfigPersistence(tmp)
cfg := config.NewDefaultAIConfig()
cfg.ControlLevel = config.ControlLevelReadOnly
- cfg.ProtectedGuests = []string{"vm-101"}
cfg.PatrolAutonomyLevel = config.PatrolAutonomyMonitor
require.NoError(t, persistence.SaveAIConfig(*cfg))
handler := newTestAISettingsHandler(&config.Config{DataPath: tmp}, persistence, nil)
@@ -3902,7 +3895,6 @@ func TestAssistantLegacyClientUpdateKeepsEntitlementAndPreference(t *testing.T)
want = config.ControlLevelAutonomous
}
require.Equal(t, want, persisted.ControlLevel)
- require.Equal(t, []string{"vm-101"}, persisted.ProtectedGuests)
require.Equal(t, config.PatrolAutonomyMonitor, persisted.PatrolAutonomyLevel)
})
}
@@ -3915,7 +3907,6 @@ func TestAssistantProjectedModeEchoPreservesLegacyPolicy(t *testing.T) {
persistence := config.NewConfigPersistence(tmp)
cfg := config.NewDefaultAIConfig()
cfg.ControlLevel = config.ControlLevelAutonomous
- cfg.ProtectedGuests = []string{"vm-101"}
cfg.PatrolAutonomyLevel = config.PatrolAutonomyFull
cfg.PatrolActionEmergencyStop = true
require.NoError(t, persistence.SaveAIConfig(*cfg))
@@ -3937,7 +3928,6 @@ func TestAssistantProjectedModeEchoPreservesLegacyPolicy(t *testing.T) {
require.Equal(t, config.ControlLevelAutonomous, persisted.ControlLevel, "a mode echo must not change legacy command admission")
require.Equal(t, licensed, handler.defaultAIService.IsAutonomous(), "legacy entitlement/approval selection is unchanged")
require.Equal(t, 120, persisted.RequestTimeoutSeconds)
- require.Equal(t, []string{"vm-101"}, persisted.ProtectedGuests)
require.Equal(t, config.PatrolAutonomyFull, persisted.PatrolAutonomyLevel)
require.True(t, persisted.PatrolActionEmergencyStop)
// Explicit opt-out and a later opt-in remain real mode changes.
diff --git a/internal/api/assistant_locked_resource_planning_test.go b/internal/api/assistant_locked_resource_planning_test.go
new file mode 100644
index 0000000000..46e52d9fc0
--- /dev/null
+++ b/internal/api/assistant_locked_resource_planning_test.go
@@ -0,0 +1,236 @@
+package api
+
+import (
+ "context"
+ "encoding/json"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/rcourtman/pulse-go-rewrite/internal/ai/tools"
+ "github.com/rcourtman/pulse-go-rewrite/internal/config"
+ "github.com/rcourtman/pulse-go-rewrite/internal/models"
+ unified "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
+)
+
+// assistantPlanningProvider is the unified inventory the Assistant tool layer
+// resolves pulse_control references against.
+type assistantPlanningProvider struct{ resources []unified.Resource }
+
+func (p assistantPlanningProvider) GetByType(t unified.ResourceType) []unified.Resource {
+ var out []unified.Resource
+ for _, resource := range p.resources {
+ if resource.Type == t {
+ out = append(out, resource)
+ }
+ }
+ return out
+}
+
+// assistantTenantSeedProvider seeds one tenant with the VM and every other
+// tenant with nothing.
+type assistantTenantSeedProvider struct {
+ orgID string
+ snapshot models.StateSnapshot
+ vm unified.Resource
+}
+
+func (p assistantTenantSeedProvider) GetStateForTenant(string) models.StateSnapshot {
+ return p.snapshot
+}
+
+func (p assistantTenantSeedProvider) UnifiedReadStateForTenant(orgID string) unified.ReadState {
+ return SnapshotReadState(p.GetStateForTenant(orgID))
+}
+
+func (p assistantTenantSeedProvider) UnifiedResourceSnapshotForTenant(orgID string) ([]unified.Resource, time.Time) {
+ if orgID != p.orgID {
+ return nil, p.snapshot.LastUpdate
+ }
+ return []unified.Resource{p.vm}, p.snapshot.LastUpdate
+}
+
+// newAssistantPlanningHarness wires the production Assistant planning chain
+// for one tenant: the pulse_control tool executor, the assistantTypedActionPlanner,
+// the real action lifecycle and the real Proxmox guest executor, with only the
+// typed node runner faked. The seeded VM is named "guest" with VMID 160. The
+// returned store is the tenant's lifecycle store, which is where the operator
+// writes a lock and where dispatch reads it.
+func newAssistantPlanningHarness(t *testing.T, orgID string) (*tools.PulseToolExecutor, unified.ResourceStore, unified.Resource) {
+ t.Helper()
+ now := time.Now().UTC()
+ vm := proxmoxGuestActionResource("vm:160", unified.ResourceTypeVM, "running", now)
+ h := newActionTestResourceHandlers(t, &config.Config{DataPath: t.TempDir()})
+ snapshot := models.StateSnapshot{LastUpdate: now}
+ if orgID == "default" {
+ h.SetStateProvider(resourceUnifiedSeedProvider{snapshot: snapshot, resources: []unified.Resource{vm}})
+ } else {
+ h.SetTenantStateProvider(assistantTenantSeedProvider{orgID: orgID, snapshot: snapshot, vm: vm})
+ }
+ h.SetActionExecutor(newRoutedActionExecutor(h, newProxmoxGuestActionExecutor(h, &fakeProxmoxActionAgentCommander{}, nil)))
+
+ store, err := h.getStore(orgID)
+ if err != nil {
+ t.Fatalf("getStore(%q): %v", orgID, err)
+ }
+ exec := tools.NewPulseToolExecutor(tools.ExecutorConfig{})
+ exec.SetOrgID(orgID)
+ exec.SetControlLevel(tools.ControlLevelControlled)
+ exec.SetUnifiedResourceProvider(assistantPlanningProvider{resources: []unified.Resource{vm}})
+ exec.SetTypedActionPlanner(assistantTypedActionPlanner{resources: h})
+ return exec, store, vm
+}
+
+func assistantRestart(t *testing.T, exec *tools.PulseToolExecutor, ref string) (result tools.CallToolResult, decoded map[string]any, raw string) {
+ t.Helper()
+ result, err := exec.ExecuteTool(context.Background(), "pulse_control", map[string]any{"type": "resource", "resource_id": ref, "action": "restart"})
+ if err != nil {
+ t.Fatalf("pulse_control: %v", err)
+ }
+ var text strings.Builder
+ for _, content := range result.Content {
+ text.WriteString(content.Text)
+ }
+ raw = text.String()
+ if err := json.Unmarshal([]byte(raw), &decoded); err != nil {
+ t.Fatalf("pulse_control result is not JSON: %v: %s", err, raw)
+ }
+ return result, decoded, raw
+}
+
+func assertAssistantPlanned(t *testing.T, result tools.CallToolResult, decoded map[string]any, raw string) {
+ t.Helper()
+ if result.IsError || decoded["planned"] != true || decoded["requested_action"] != "restart" || decoded["capability"] != "reboot" || decoded["execution_requested"] != false {
+ t.Fatalf("expected a saved, unexecuted plan, got isError=%v %s", result.IsError, raw)
+ }
+}
+
+// assertAssistantLockRefusal checks the exact blocked-tool-response shape the
+// agentic loop forwards to the model.
+func assertAssistantLockRefusal(t *testing.T, result tools.CallToolResult, decoded map[string]any, raw string) {
+ t.Helper()
+ if !result.IsError || decoded["ok"] != false || decoded["planned"] != nil {
+ t.Fatalf("a blocked resource must return an error result without a plan, got isError=%v %s", result.IsError, raw)
+ }
+ errObj, _ := decoded["error"].(map[string]any)
+ details, _ := errObj["details"].(map[string]any)
+ if errObj["code"] != "ACTION_NOT_ALLOWED" || errObj["blocked"] != true || details["reason_code"] != "resource_remediation_locked" || details["requested_action"] != "restart" {
+ t.Fatalf("unexpected refusal envelope: %s", raw)
+ }
+ message, _ := errObj["message"].(string)
+ boundary, _ := details["policy_boundary"].(string)
+ for _, want := range []string{"Never auto-remediate", "Retired"} {
+ if !strings.Contains(message, want) {
+ t.Fatalf("refusal message must name both blocking states, missing %q: %s", want, message)
+ }
+ }
+ for _, want := range []string{"Operator overrides", "turn off Never auto-remediate", "set it back to Active", "then save"} {
+ if !strings.Contains(boundary, want) {
+ t.Fatalf("policy boundary must say how to clear the block, missing %q: %s", want, boundary)
+ }
+ }
+}
+
+func assistantActionAuditCount(t *testing.T, store unified.ResourceStore, resourceID string) int {
+ t.Helper()
+ audits, err := store.GetActionAudits(resourceID, time.Time{}, 10)
+ if err != nil {
+ t.Fatalf("GetActionAudits: %v", err)
+ }
+ return len(audits)
+}
+
+func TestAssistantPlansRestartForUnlockedGuest(t *testing.T) {
+ exec, store, vm := newAssistantPlanningHarness(t, "default")
+
+ result, decoded, raw := assistantRestart(t, exec, "guest")
+ assertAssistantPlanned(t, result, decoded, raw)
+ if got := assistantActionAuditCount(t, store, vm.ID); got != 1 {
+ t.Fatalf("planned action audits = %d, want 1", got)
+ }
+}
+
+// The operator lock ("Never auto-remediate") and a retired lifecycle refuse
+// every dispatch for the resource, approved or not. The Assistant must say so
+// at planning time rather than leave a plan in Actions that can never run.
+func TestAssistantDeclinesToPlanAgainstBlockedGuest(t *testing.T) {
+ for _, tc := range []struct {
+ name string
+ state unified.ResourceOperatorState
+ }{
+ {"never auto-remediate", unified.ResourceOperatorState{NeverAutoRemediate: true}},
+ {"retired lifecycle", unified.ResourceOperatorState{LifecycleState: unified.LifecycleStateRetired}},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ exec, store, vm := newAssistantPlanningHarness(t, "default")
+ state := tc.state
+ state.CanonicalID, state.SetAt, state.SetBy = vm.ID, time.Now().UTC(), "operator:test"
+ if err := store.SetResourceOperatorState(state); err != nil {
+ t.Fatalf("SetResourceOperatorState: %v", err)
+ }
+
+ result, decoded, raw := assistantRestart(t, exec, "guest")
+ assertAssistantLockRefusal(t, result, decoded, raw)
+ if got := assistantActionAuditCount(t, store, vm.ID); got != 0 {
+ t.Fatalf("a refused plan wrote %d action audit(s)", got)
+ }
+
+ if err := store.ClearResourceOperatorState(vm.ID); err != nil {
+ t.Fatalf("ClearResourceOperatorState: %v", err)
+ }
+ result, decoded, raw = assistantRestart(t, exec, "guest")
+ assertAssistantPlanned(t, result, decoded, raw)
+ })
+ }
+}
+
+// Only NeverAutoRemediate and a retired lifecycle block remediation. The other
+// operator overrides change alerting and Patrol attention, not whether the
+// Assistant may propose an action.
+func TestAssistantStillPlansWhenOnlyNonBlockingOverridesAreSet(t *testing.T) {
+ for _, tc := range []struct {
+ name string
+ state unified.ResourceOperatorState
+ }{
+ {"intentionally offline", unified.ResourceOperatorState{IntentionallyOffline: true}},
+ {"muted", unified.ResourceOperatorState{MonitoringMode: unified.MonitoringModeMuted}},
+ {"high criticality", unified.ResourceOperatorState{Criticality: unified.CriticalityHigh}},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ exec, store, vm := newAssistantPlanningHarness(t, "default")
+ state := tc.state
+ state.CanonicalID, state.SetAt, state.SetBy = vm.ID, time.Now().UTC(), "operator:test"
+ if err := store.SetResourceOperatorState(state); err != nil {
+ t.Fatalf("SetResourceOperatorState: %v", err)
+ }
+
+ result, decoded, raw := assistantRestart(t, exec, "guest")
+ assertAssistantPlanned(t, result, decoded, raw)
+ })
+ }
+}
+
+// A non-default tenant keeps its operator state in the lifecycle store under its
+// own org. The planner must read that store, not the default tenant's.
+func TestAssistantReadsTheTenantsOwnLockState(t *testing.T) {
+ const orgID = "org-b"
+ exec, store, vm := newAssistantPlanningHarness(t, orgID)
+
+ if err := store.SetResourceOperatorState(unified.ResourceOperatorState{
+ CanonicalID: vm.ID, NeverAutoRemediate: true, SetAt: time.Now().UTC(), SetBy: "operator:test",
+ }); err != nil {
+ t.Fatalf("SetResourceOperatorState: %v", err)
+ }
+
+ result, decoded, raw := assistantRestart(t, exec, "guest")
+ assertAssistantLockRefusal(t, result, decoded, raw)
+ if got := assistantActionAuditCount(t, store, vm.ID); got != 0 {
+ t.Fatalf("a refused tenant plan wrote %d action audit(s)", got)
+ }
+
+ if err := store.ClearResourceOperatorState(vm.ID); err != nil {
+ t.Fatalf("ClearResourceOperatorState: %v", err)
+ }
+ result, decoded, raw = assistantRestart(t, exec, "guest")
+ assertAssistantPlanned(t, result, decoded, raw)
+}
diff --git a/internal/api/assistant_typed_action_planner.go b/internal/api/assistant_typed_action_planner.go
index 8bc13bb321..cbaf7e89e8 100644
--- a/internal/api/assistant_typed_action_planner.go
+++ b/internal/api/assistant_typed_action_planner.go
@@ -2,8 +2,10 @@ package api
import (
"context"
+ "fmt"
unified "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
+ "github.com/rs/zerolog/log"
)
type assistantTypedActionPlanner struct {
@@ -12,7 +14,22 @@ type assistantTypedActionPlanner struct {
func (p assistantTypedActionPlanner) PlanTypedAction(ctx context.Context, orgID string, req unified.ActionRequest) (*unified.ActionPlan, error) {
actor := unified.ActionActor{SubjectID: "pulse_assistant", Kind: unified.ActionActorService, CredentialID: "service:assistant", OrgID: orgID}
- plan, err := p.resources.ActionLifecycle().Plan(ctx, orgID, req, actor)
+ lifecycle := p.resources.ActionLifecycle()
+
+ // Operator state that blocks remediation (Never auto-remediate, or a retired
+ // lifecycle) already refuses every dispatch for the resource, approved or not.
+ // Refuse the Assistant's plan too, so it reports the block instead of leaving
+ // a plan in Actions that can never run. The state is read through the same
+ // tenant-scoped lifecycle store dispatch uses. A state that cannot be read is
+ // not a refusal here: planning executes nothing and dispatch re-checks.
+ if state, found, err := lifecycle.ResourceOperatorState(orgID, req.ResourceID); err != nil {
+ log.Warn().Err(err).Str("org_id", orgID).Str("resource_id", req.ResourceID).
+ Msg("Assistant planning could not read resource operator state; dispatch will re-check")
+ } else if found && state.BlocksRemediation() {
+ return nil, fmt.Errorf("%w: %s", unified.ErrResourceRemediationLocked, unified.CanonicalResourceID(req.ResourceID))
+ }
+
+ plan, err := lifecycle.Plan(ctx, orgID, req, actor)
if err != nil {
return nil, err
}
diff --git a/internal/api/contract_test.go b/internal/api/contract_test.go
index 5f9d67b9f6..8f291ee22f 100644
--- a/internal/api/contract_test.go
+++ b/internal/api/contract_test.go
@@ -2420,7 +2420,6 @@ func TestContract_AISettingsUpdateProviderResolutionJSONSnapshot(t *testing.T) {
"ollama_keep_alive":"",
"configured_providers":["ollama"],
"control_level":"read_only",
- "protected_guests":[],
"discovery_enabled":false,
"patrol_readiness":{
"status":"warning",
@@ -2615,7 +2614,6 @@ func TestContract_AISettingsBYOKOverrideDoesNotExposeQuickstartInventoryJSONSnap
"ollama_keep_alive":"",
"configured_providers":["openai"],
"control_level":"read_only",
- "protected_guests":[],
"discovery_enabled":false,
"patrol_readiness":{"status":"not_ready","ready":false,"cause":"service_unavailable","summary":"Pulse Patrol service is not available.","checks":[{"id":"service","status":"not_ready","cause":"service_unavailable","label":"Patrol service","message":"Pulse Patrol service is not available.","action":"restart_service"}]}
}`
@@ -4770,7 +4768,6 @@ func TestContract_HostedAISettingsDoesNotAutoBootstrapQuickstartJSONSnapshot(t *
"ollama_keep_alive":"",
"configured_providers":[],
"control_level":"read_only",
- "protected_guests":[],
"discovery_enabled":false,
"patrol_readiness":{"status":"not_ready","ready":false,"cause":"service_unavailable","summary":"Pulse Patrol service is not available.","checks":[{"id":"service","status":"not_ready","cause":"service_unavailable","label":"Patrol service","message":"Pulse Patrol service is not available.","action":"restart_service"}]}
}`
@@ -4841,7 +4838,6 @@ func TestContract_AISettingsRetiredQuickstartAliasJSONSnapshot(t *testing.T) {
"ollama_keep_alive":"",
"configured_providers":[],
"control_level":"read_only",
- "protected_guests":[],
"discovery_enabled":false,
"patrol_readiness":{"status":"not_ready","ready":false,"cause":"service_unavailable","summary":"Pulse Patrol service is not available.","checks":[{"id":"service","status":"not_ready","cause":"service_unavailable","label":"Patrol service","message":"Pulse Patrol service is not available.","action":"restart_service"}]}
}`
@@ -4917,7 +4913,6 @@ func TestContract_AISettingsOllamaAuthJSONSnapshot(t *testing.T) {
"ollama_keep_alive":"",
"configured_providers":["ollama"],
"control_level":"read_only",
- "protected_guests":[],
"discovery_enabled":false,
"patrol_readiness":{"status":"not_ready","ready":false,"cause":"service_unavailable","summary":"Pulse Patrol service is not available.","checks":[{"id":"service","status":"not_ready","cause":"service_unavailable","label":"Patrol service","message":"Pulse Patrol service is not available.","action":"restart_service"}]}
}`
@@ -6188,7 +6183,6 @@ func TestContract_HostedTenantAISettingsDoesNotAutoBootstrapQuickstartJSONSnapsh
"ollama_keep_alive":"",
"configured_providers":[],
"control_level":"read_only",
- "protected_guests":[],
"discovery_enabled":false,
"patrol_readiness":{"status":"not_ready","ready":false,"cause":"service_unavailable","summary":"Pulse Patrol service is not available.","checks":[{"id":"service","status":"not_ready","cause":"service_unavailable","label":"Patrol service","message":"Pulse Patrol service is not available.","action":"restart_service"}]}
}`
@@ -20084,7 +20078,7 @@ func TestContract_AssistantProviderSeamsDoNotUseMCPTerminology(t *testing.T) {
settingsHandler := string(settingsHandlerSource)
for _, fragment := range []string{
`Used by Router to update Assistant tool visibility without restarting AI chat.`,
- `Update Assistant control settings if control level or protected guests changed.`,
+ `Update Assistant control settings if the control level changed.`,
`This updates tool visibility without restarting AI chat.`,
} {
if !strings.Contains(settingsHandler, fragment) {
@@ -27097,8 +27091,8 @@ func TestContract_AssistantSettingsAdvertisePlanningNotExecution(t *testing.T) {
if string(payload["control_level"]) != `"controlled"` {
t.Fatalf("interactive control_level %s", payload["control_level"])
}
- if string(payload["protected_guests"]) != "[]" {
- t.Fatalf("protected_guests must remain an explicit array: %s", payload["protected_guests"])
+ if _, ok := payload["protected_guests"]; ok {
+ t.Fatalf("the retired protected_guests field must not be projected: %s", payload["protected_guests"])
}
}
}
diff --git a/internal/config/ai.go b/internal/config/ai.go
index 02ed985f99..ca36638494 100644
--- a/internal/config/ai.go
+++ b/internal/config/ai.go
@@ -116,8 +116,7 @@ type AIConfig struct {
// AI Infrastructure Control settings
// These control whether AI can take actions on infrastructure (start/stop VMs, containers, etc.)
- ControlLevel string `json:"control_level,omitempty"` // "read_only", "controlled", "autonomous"
- ProtectedGuests []string `json:"protected_guests,omitempty"` // VMIDs or names that AI cannot control
+ ControlLevel string `json:"control_level,omitempty"` // "read_only", "controlled", "autonomous"
// Patrol Autonomy settings - controls automatic investigation and remediation of findings
PatrolAutonomyLevel string `json:"patrol_autonomy_level,omitempty"` // "monitor", "approval", "assisted", "full"
@@ -1040,14 +1039,6 @@ func IsValidControlLevel(level string) bool {
return agentcapabilities.IsValidControlLevel(level)
}
-// GetProtectedGuests returns the list of protected guests (VMIDs or names)
-func (c *AIConfig) GetProtectedGuests() []string {
- if c.ProtectedGuests == nil {
- return []string{}
- }
- return c.ProtectedGuests
-}
-
// GetPatrolAutonomyLevel returns the patrol autonomy level, defaulting to "monitor" if not set
func (c *AIConfig) GetPatrolAutonomyLevel() string {
if c.PatrolAutonomyLevel == "" {
diff --git a/internal/config/ai_additional_test.go b/internal/config/ai_additional_test.go
index 7a5597d09d..3b8b8d27ff 100644
--- a/internal/config/ai_additional_test.go
+++ b/internal/config/ai_additional_test.go
@@ -113,18 +113,7 @@ func TestAIConfig_PatrolSettings(t *testing.T) {
}
}
-func TestAIConfig_ProtectedGuestsAndValidation(t *testing.T) {
- cfg := &AIConfig{}
- if guests := cfg.GetProtectedGuests(); len(guests) != 0 {
- t.Fatalf("expected empty protected guests, got %v", guests)
- }
-
- cfg.ProtectedGuests = []string{"vm-100", "vm-200"}
- guests := cfg.GetProtectedGuests()
- if len(guests) != 2 || guests[0] != "vm-100" {
- t.Fatalf("unexpected protected guests: %v", guests)
- }
-
+func TestAIConfig_ControlAndPatrolLevelValidation(t *testing.T) {
if IsValidControlLevel("bad") {
t.Fatalf("expected invalid control level to be false")
}
diff --git a/internal/config/ai_config_test.go b/internal/config/ai_config_test.go
index 706e6f9ddf..4d83c86a54 100644
--- a/internal/config/ai_config_test.go
+++ b/internal/config/ai_config_test.go
@@ -1411,7 +1411,6 @@ func TestAssistantControlProjectionPreservesSavedPolicy(t *testing.T) {
cfg.ControlLevel = level
cfg.PatrolAutonomyLevel = PatrolAutonomyFull
cfg.PatrolActionEmergencyStop = true
- cfg.ProtectedGuests = []string{"vm-101"}
before := *cfg
want := ControlLevelReadOnly
if level == ControlLevelControlled || level == ControlLevelAutonomous {
diff --git a/scripts/release_control/ai_runtime_docs_policy_test.py b/scripts/release_control/ai_runtime_docs_policy_test.py
index 53e53a2c6f..836cf747c3 100644
--- a/scripts/release_control/ai_runtime_docs_policy_test.py
+++ b/scripts/release_control/ai_runtime_docs_policy_test.py
@@ -331,7 +331,7 @@ class AIRuntimeDocsPolicyTest(unittest.TestCase):
start = text.index("## Assistant Control Levels" if name == "AI_AUTONOMY.md" else "### Control Levels")
end = text.index("\n---", start)
section = " ".join(text[start:end].split())
- for retained in ("Read-only", "Ask first", "Actions", "does not execute", "stored", "entitlement", "Patrol", "verification", "Protected guests (legacy)", "does not exclude saved action plans"):
+ for retained in ("Read-only", "Ask first", "Actions", "does not execute", "stored", "entitlement", "Patrol", "verification", "Never auto-remediate", "has been removed"):
self.assertIn(retained, section)
for retired in ("executes commands without prompting", "AI executes actions without prompting", "APPROVAL_REQUIRED", "Approve** to execute"):
self.assertNotIn(retired, section)
diff --git a/tests/integration/tests/51-quickstart-cross-surface.spec.ts b/tests/integration/tests/51-quickstart-cross-surface.spec.ts
index 69b6b2e960..fd9cfe76dc 100644
--- a/tests/integration/tests/51-quickstart-cross-surface.spec.ts
+++ b/tests/integration/tests/51-quickstart-cross-surface.spec.ts
@@ -29,7 +29,6 @@ type AISettingsPayload = {
ollama_password_set: boolean;
configured_providers: string[];
control_level: string;
- protected_guests: string[];
discovery_enabled: boolean;
};
@@ -84,7 +83,6 @@ const baseAISettings = (): AISettingsPayload => ({
ollama_password_set: false,
configured_providers: [],
control_level: "read_only",
- protected_guests: [],
discovery_enabled: false,
});