Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Make model security screening opt-in (#1201)

Regan Bell44e49c458f66
diff --git a/README.md b/README.md
index f35fc680c..8daea7812 100644
--- a/README.md
+++ b/README.md
@@ -102,9 +102,9 @@ can only tighten:
- **Strict** — every harness tool call pauses for human approval, except the two
no-effect turn enders.
-- **Auto** (default) — a classifier screens provenance-labelled external data and tool
- results before they reach the model; a deployment can point that at its own screening
- proxy.
+- **Auto** (default) — blocks private-network access and uses a content screener when
+ the deployment configures one. Model screening is off by default; deployments can
+ use an external proxy or explicitly opt into the built-in model classifier.
- **Dangerous** — no content screening, no pauses between tool calls.
The predeclared command policy — approval rules and hard denials for things like
diff --git a/cli/README.md b/cli/README.md
index 2cf07c635..9e21ba773 100644
--- a/cli/README.md
+++ b/cli/README.md
@@ -81,9 +81,11 @@ point (`aws rds restore-db-instance-to-point-in-time`);
sandboxes boot their platform's stock image; tools and skills arrive through the
deployment-layer sync, which every ordinary `up` performs.
-Auto uses its built-in model classifier unless `qm.config.jsonc` declares one
-`securityScreen` proxy with a provider label, HTTPS endpoint, and `shadow` or
-`enforce` rollout. The proxy token is routed separately through
+Model screening is off by default. Set `securityScreen: { "backend": "model" }`
+to opt in, or configure a `securityScreen` proxy with a provider label, HTTPS
+endpoint, and `enforce` rollout to use an external screener without model fallback.
+The optional `shadow` rollout explicitly runs the model classifier and compares
+the proxy verdict. Route the proxy token through
`secretEnv.core.SECURITY_SCREEN_PROXY_TOKEN`.
## Commands
diff --git a/cli/src/backends/fly.ts b/cli/src/backends/fly.ts
index 74b6ec81a..8c914dd76 100644
--- a/cli/src/backends/fly.ts
+++ b/cli/src/backends/fly.ts
@@ -1011,7 +1011,7 @@ function runFlyDeploy(args: string[], cwd: string): Promise<void> {
}
function unsetDisabledSecurityScreenToken(config: QmConfig, appPrefix: string): void {
- if (config.securityScreen) return;
+ if (config.securityScreen?.backend === "proxy") return;
const app = `${appPrefix}-core`;
if (!secretNames(app)?.has("SECURITY_SCREEN_PROXY_TOKEN")) return;
fly(["secrets", "unset", "--stage", "-a", app, "SECURITY_SCREEN_PROXY_TOKEN"]);
diff --git a/cli/src/config.ts b/cli/src/config.ts
index bf17e63c7..25b51b285 100644
--- a/cli/src/config.ts
+++ b/cli/src/config.ts
@@ -54,12 +54,14 @@ export interface SandboxConfig {
secretEnv?: string[];
}
-export interface SecurityScreenConfig {
- backend: "proxy";
- provider: string;
- endpoint: string;
- rollout: "shadow" | "enforce";
-}
+export type SecurityScreenConfig =
+ | { backend: "off" | "model" }
+ | {
+ backend: "proxy";
+ provider: string;
+ endpoint: string;
+ rollout: "shadow" | "enforce";
+ };
export interface AwsServiceConfig {
ecrRepository: string;
@@ -169,7 +171,7 @@ export interface QmConfig {
export function securityScreenEnv(config: Pick<QmConfig, "securityScreen">): Record<string, string> {
const screen = config.securityScreen;
- if (!screen) return {};
+ if (!screen || screen.backend !== "proxy") return { SECURITY_SCREEN_BACKEND: screen?.backend ?? "off" };
return {
SECURITY_SCREEN_BACKEND: screen.backend,
SECURITY_SCREEN_PROXY_PROVIDER: screen.provider,
@@ -420,11 +422,18 @@ const isPlainObject = (x: unknown): x is Record<string, unknown> =>
function validateSecurityScreen(raw: unknown, path: string): SecurityScreenConfig | undefined {
if (raw === undefined) return undefined;
if (!isPlainObject(raw)) throw new CliError(`${path}: "securityScreen" must be an object`);
+ if (raw.backend === "off" || raw.backend === "model") {
+ if (Object.keys(raw).some((key) => key !== "backend")) {
+ throw new CliError(`${path}: securityScreen provider, endpoint, and rollout require backend proxy`);
+ }
+ return { backend: raw.backend };
+ }
const allowed = new Set(["backend", "provider", "endpoint", "rollout"]);
for (const key of Object.keys(raw)) {
if (!allowed.has(key)) throw new CliError(`${path}: "securityScreen.${key}" is not recognized`);
}
- if (raw.backend !== "proxy") throw new CliError(`${path}: "securityScreen.backend" must be "proxy"`);
+ if (raw.backend !== "proxy")
+ throw new CliError(`${path}: "securityScreen.backend" must be "off", "model", or "proxy"`);
if (
typeof raw.provider !== "string" ||
raw.provider.length > 63 ||
@@ -627,10 +636,10 @@ function validate(raw: unknown, path: string): QmConfig {
throw new CliError(`${path}: SECURITY_SCREEN_PROXY_TOKEN may be routed only to core`);
}
}
- if (securityScreen && secretEnv.core?.SECURITY_SCREEN_PROXY_TOKEN === undefined) {
+ if (securityScreen?.backend === "proxy" && secretEnv.core?.SECURITY_SCREEN_PROXY_TOKEN === undefined) {
throw new CliError(`${path}: securityScreen requires secretEnv.core.SECURITY_SCREEN_PROXY_TOKEN`);
}
- if (!securityScreen && secretEnv.core?.SECURITY_SCREEN_PROXY_TOKEN !== undefined) {
+ if (securityScreen?.backend !== "proxy" && secretEnv.core?.SECURITY_SCREEN_PROXY_TOKEN !== undefined) {
throw new CliError(`${path}: secretEnv.core.SECURITY_SCREEN_PROXY_TOKEN requires securityScreen`);
}
for (const [service, values] of Object.entries(env)) {
diff --git a/cli/test/config.test.ts b/cli/test/config.test.ts
index 279f60566..4dac1d9f9 100644
--- a/cli/test/config.test.ts
+++ b/cli/test/config.test.ts
@@ -11,6 +11,7 @@ import {
loadConfigInDir,
mockHarnessWarning,
sandboxCoreEnv,
+ securityScreenEnv,
updateConfigImageOverrides,
} from "../src/config.ts";
@@ -1266,3 +1267,20 @@ test("blank model provider overrides preserve the declared provider in runtime a
},
);
});
+
+test("screening defaults off and model screening requires an explicit backend", () => {
+ assert.deepEqual(securityScreenEnv({}), { SECURITY_SCREEN_BACKEND: "off" });
+ for (const backend of ["off", "model"] as const) {
+ withConfig({ securityScreen: { backend } }, ({ path }) => {
+ const { config } = loadConfigAt(path);
+ assert.deepEqual(securityScreenEnv(config), { SECURITY_SCREEN_BACKEND: backend });
+ });
+ withConfig({ securityScreen: { backend, rollout: "enforce" } }, ({ path }) =>
+ assert.throws(() => loadConfigAt(path), /require backend proxy/),
+ );
+ withConfig(
+ { securityScreen: { backend }, secretEnv: { core: { SECURITY_SCREEN_PROXY_TOKEN: "TOKEN" } } },
+ ({ path }) => assert.throws(() => loadConfigAt(path), /requires securityScreen/),
+ );
+ }
+});
diff --git a/deploy/core/fly.toml b/deploy/core/fly.toml
index 78fc1b91f..91a137137 100644
--- a/deploy/core/fly.toml
+++ b/deploy/core/fly.toml
@@ -20,6 +20,7 @@ primary_region = "sjc"
FLY_ORG = "personal"
FLY_DEPLOY_APP_PREFIX = "qm-d"
SANDBOX_BACKEND = "sprites"
+ SECURITY_SCREEN_BACKEND = "off"
[deploy]
strategy = "bluegreen"
diff --git a/docs/deploy-directory.md b/docs/deploy-directory.md
index 3a6ee4e79..ad7b4d5d5 100644
--- a/docs/deploy-directory.md
+++ b/docs/deploy-directory.md
@@ -23,7 +23,7 @@ The Dockerfile is optional when every declared binary is present in its tool dir
The root object requires `contract: 1`, `orgId`, `publicUrl`, `target`, and `services` including `core`. On AWS the sandbox substrate is an explicit choice: omitting the `sandbox` block runs named Lambda MicroVM images; declaring one requires `sandbox.backend` — `"sprites"` runs Fly Sprites, `"aws"` states the MicroVM default in the file. Unknown contract majors fail closed. `target` is `docker`, `fly`, or `aws`.
-Common optional fields select the model, plugins, extra skill directories, per-service non-secret environment values, image overrides, sandbox settings, and an external security screen. `botName` (at most 31 characters, so the generated "`<botName>` SSO" app name fits Slack's 35-character cap) names the bot everywhere users see it — the generated Slack app manifests, the prompt identity, and sign-in pages — and `orgName` (at most 40) is how the bot refers to the organization; both default to neutral values and can be changed live from the Admin page's Branding card, which then takes precedence over the deployed values. `sandbox.backend` selects the aws-target sandbox substrate (see above); `sandbox.baseImage` records the digest-pinned build input for local layer builds; `sandbox.env` is non-secret runtime environment; `sandbox.secretEnv` lists org-wide secret names whose values are forwarded to every sandbox. `securityScreen` contains `backend: "proxy"`, a lowercase provider label, an HTTPS endpoint, and a `shadow` or `enforce` rollout. Its presence requires `secretEnv.core.SECURITY_SCREEN_PROXY_TOKEN`; absence keeps Auto on the built-in model classifier.
+Common optional fields select the model, plugins, extra skill directories, per-service non-secret environment values, image overrides, sandbox settings, and an external security screen. `botName` (at most 31 characters, so the generated "`<botName>` SSO" app name fits Slack's 35-character cap) names the bot everywhere users see it — the generated Slack app manifests, the prompt identity, and sign-in pages — and `orgName` (at most 40) is how the bot refers to the organization; both default to neutral values and can be changed live from the Admin page's Branding card, which then takes precedence over the deployed values. `sandbox.backend` selects the aws-target sandbox substrate (see above); `sandbox.baseImage` records the digest-pinned build input for local layer builds; `sandbox.env` is non-secret runtime environment; `sandbox.secretEnv` lists org-wide secret names whose values are forwarded to every sandbox. `securityScreen` contains `backend: "proxy"`, a lowercase provider label, an HTTPS endpoint, and a `shadow` or `enforce` rollout. Its presence requires `secretEnv.core.SECURITY_SCREEN_PROXY_TOKEN`; absence disables model screening. Set `securityScreen: { "backend": "model" }` to opt into the built-in model classifier, or `{ "backend": "off" }` to explicitly disable screening. Proxy `enforce` uses only the external screener, with no model fallback on errors; `shadow` explicitly runs the model classifier and compares the external verdict. Security posture and tool approval settings remain independent.
Fly requires `region` and `flyOrg`. AWS requires a 12-digit account, region, deployment label, ECS cluster, deploy-role ARN, Secrets Manager prefix, DNS-valid Cloud Map namespace, and an entry for every enabled first-party service and discovered plugin containing a unique valid ECR repository, a unique valid ECS service, and a valid Fargate CPU/memory combination. The cluster is constrained so every IAM, RDS, ALB, and related name derived by the reference module is valid. `imageLabel` identifies the complete deployment manifest used by rollback and live drift checks; the matching OCI/ECR tag is a convenience pointer. Workloads may also set `arm64`/`amd64` architecture, non-secret build arguments, or role ARNs. External prebuilt images must declare their architecture; source-built and built-in workloads use their platform default. Cloud Map names are the private workload addresses. The reference AWS module exposes CloudFront over HTTPS and restricts its HTTP ALB origin to CloudFront's managed origin prefix. With portal enabled, it is the ALB's sole target; access to private core, web, and admin surfaces requires signed portal identity. Without portal, only core is an ALB target. A real harness requires an HTTPS `publicUrl`.
diff --git a/plugins/admin/public/index.html b/plugins/admin/public/index.html
index c20d045f8..f7d81c657 100644
--- a/plugins/admin/public/index.html
+++ b/plugins/admin/public/index.html
@@ -5242,7 +5242,7 @@
<div class="body">
<select id="security-posture" data-choice-state hidden>
<option value="dangerous">Dangerous — no content scans; nothing pauses between tool calls</option>
- <option value="auto">Auto — screen external content with proxy or model</option>
+ <option value="auto">Auto — use the deployment’s configured screener</option>
<option value="strict">Strict — approve tool actions</option>
</select>
<div class="choice-stack">
@@ -5255,8 +5255,8 @@
/><span
><strong>Auto</strong
><small
- >Default. External content (web pages, tool output, files) is screened for prompt injection
- before the agent acts on it.</small
+ >Default. Blocks private-network access. Screens external content when the deployment
+ configures a screener; model screening is off by default.</small
></span
></label
>
@@ -5289,8 +5289,8 @@
<div class="head">
<h2>Auto flagger</h2>
<p>
- Model and prompt that decide whether external context and tool results are quarantined in Auto
- mode. The security boundary and required verdict format remain fixed.
+ Model and prompt used when the deployment explicitly enables model screening in Auto mode. These
+ settings do not enable screening. The security boundary and required verdict format remain fixed.
</p>
</div>
<div class="body">
diff --git a/src/config.ts b/src/config.ts
index 2ec51f0da..df0d4b6a9 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -162,7 +162,7 @@ export interface Config {
approvalSummaryTimeoutMs: number;
turnLeaseWaitMs: number;
securityScreenTimeoutMs: number;
- securityScreenBackend: "model" | "proxy";
+ securityScreenBackend: "off" | "model" | "proxy";
securityScreenProxy?: {
provider: string;
endpoint: string;
@@ -915,11 +915,11 @@ function sharingPostureEnvStrict(value: string | undefined): SharingPosture {
}
function securityScreenBackendEnvStrict(value: string | undefined): Config["securityScreenBackend"] {
- if (value === undefined || value.trim() === "") return "model";
+ if (value === undefined || value.trim() === "") return "off";
const backend = value.trim().toLowerCase();
- if (backend === "model" || backend === "proxy") return backend;
+ if (backend === "off" || backend === "model" || backend === "proxy") return backend;
throw new Error(
- `SECURITY_SCREEN_BACKEND=${JSON.stringify(value)} is not recognized — use model or proxy, or unset it.`,
+ `SECURITY_SCREEN_BACKEND=${JSON.stringify(value)} is not recognized — use off, model, or proxy, or unset it.`,
);
}
@@ -1100,7 +1100,7 @@ export function loadConfig(env: NodeJS.ProcessEnv = process.env): Config {
"SECURITY_SCREEN_BACKEND=proxy requires SECURITY_SCREEN_PROXY_PROVIDER, SECURITY_SCREEN_PROXY_ENDPOINT, SECURITY_SCREEN_PROXY_TOKEN, and SECURITY_SCREEN_PROXY_ROLLOUT",
);
}
- if (securityScreenBackend === "model" && hasProxyConfig) {
+ if (securityScreenBackend !== "proxy" && hasProxyConfig) {
throw new Error("SECURITY_SCREEN_PROXY_* requires SECURITY_SCREEN_BACKEND=proxy");
}
if (proxyProvider && (proxyProvider.length > 63 || !/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(proxyProvider))) {
diff --git a/src/core/orchestrator.ts b/src/core/orchestrator.ts
index ecc0ee426..5c8f5a18b 100644
--- a/src/core/orchestrator.ts
+++ b/src/core/orchestrator.ts
@@ -1521,7 +1521,7 @@ export function createOrchestrator(deps: OrchestratorDeps): Orchestrator {
egress: egressClaimAllowingControlPlane(
resolution.egress,
deps.apiBaseUrl ?? "",
- securityPolicy.inboundScreening === "external",
+ securityPolicy.denyPrivateNetworks,
),
exp: Date.now() + CAPABILITY_TTL_MS,
},
diff --git a/src/resolution/resolution-service.ts b/src/resolution/resolution-service.ts
index 0c97536a1..218d8389c 100644
--- a/src/resolution/resolution-service.ts
+++ b/src/resolution/resolution-service.ts
@@ -22,7 +22,12 @@ export function conversationScope(
return scopeId("channel", ref);
}
-export function createResolutionService(orgId: string, config: ScopedConfigStore, acl: AclStore): ResolutionService {
+export function createResolutionService(
+ orgId: string,
+ config: ScopedConfigStore,
+ acl: AclStore,
+ screeningEnabled = true,
+): ResolutionService {
const orgScope = scopeId("org", orgId);
function scopeFor(conversation: Conversation, actor: Principal): ScopeId {
@@ -77,7 +82,8 @@ export function createResolutionService(orgId: string, config: ScopedConfigStore
const orgPolicy = config.getCommandPolicy(orgScope) ?? defaultOrgPolicy();
const scopePolicy = config.getCommandPolicy(scope) ?? undefined;
const commandPolicy = composePolicy(orgPolicy, scopePolicy);
- const securityPolicy = resolveSecurityPolicy(await config.getSecurityPostureDurable(scope));
+ let securityPolicy = resolveSecurityPolicy(await config.getSecurityPostureDurable(scope));
+ if (!screeningEnabled) securityPolicy = { ...securityPolicy, inboundScreening: "off" };
const sharingPosture = await config.resolveSharingPostureDurable(scopeId("personal", actor.id), scope);
const approvalGrantModes = await config.getApprovalGrantModesDurable(scope);
diff --git a/src/security/security-posture.ts b/src/security/security-posture.ts
index 358bda7bb..b25fb4f46 100644
--- a/src/security/security-posture.ts
+++ b/src/security/security-posture.ts
@@ -8,13 +8,14 @@ type ToolApprovalBehavior = "none" | "all";
export interface ResolvedSecurityPolicy {
readonly inboundScreening: InboundScreening;
+ readonly denyPrivateNetworks: boolean;
readonly toolApprovals: ToolApprovalBehavior;
}
const POSTURE_POLICIES: Record<SecurityPosture, ResolvedSecurityPolicy> = {
- dangerous: { inboundScreening: "off", toolApprovals: "none" },
- auto: { inboundScreening: "external", toolApprovals: "none" },
- strict: { inboundScreening: "off", toolApprovals: "all" },
+ dangerous: { inboundScreening: "off", toolApprovals: "none", denyPrivateNetworks: false },
+ auto: { inboundScreening: "external", toolApprovals: "none", denyPrivateNetworks: true },
+ strict: { inboundScreening: "off", toolApprovals: "all", denyPrivateNetworks: false },
};
export function resolveSecurityPolicy(posture: SecurityPosture): ResolvedSecurityPolicy {
diff --git a/src/wiring.ts b/src/wiring.ts
index cfb371589..4625d337e 100644
--- a/src/wiring.ts
+++ b/src/wiring.ts
@@ -706,7 +706,12 @@ export function buildApp(
config.databaseUrl && (config.budgetUsdPerWindow !== undefined || config.orgBudgetUsdPerWindow !== undefined)
? createPostgresBudgetTracker(config.databaseUrl, budgetOpts)
: createBudgetTracker(budgetOpts);
- const resolution = createResolutionService(config.orgId, configStore, acl);
+ const resolution = createResolutionService(
+ config.orgId,
+ configStore,
+ acl,
+ config.securityScreenBackend !== "off" || Boolean(overrides.securityScreener),
+ );
const workspace = createLocalWorkspaceStore(config.dataDir);
const blobTransfer: BlobTransferStore =
@@ -1269,6 +1274,14 @@ export function buildApp(
);
});
+ if (
+ config.securityScreenBackend !== "model" &&
+ !config.securityScreenProxy?.shadow &&
+ !overrides.securityScreener?.shadow
+ ) {
+ delete harness.models.screenSecurity;
+ }
+
const leaseTtlMs = config.leaseTtlMs;
const maxAttempts = config.maxAttempts;
const runStore =
diff --git a/test/config.test.ts b/test/config.test.ts
index 2e023064e..dddf5110d 100644
--- a/test/config.test.ts
+++ b/test/config.test.ts
@@ -77,7 +77,10 @@ test("production and unauthenticated-core escape hatch are parsed once", () => {
test("harness security posture defaults to auto and validates named modes", () => {
assert.equal(loadConfig({}).securityPosture, "auto");
- assert.equal(loadConfig({}).securityScreenBackend, "model");
+ assert.equal(loadConfig({}).securityScreenBackend, "off");
+ assert.equal(loadConfig({ SECURITY_SCREEN_BACKEND: "model" }).securityScreenBackend, "model");
+ assert.equal(loadConfig({ SECURITY_SCREEN_BACKEND: "off" }).securityScreenBackend, "off");
+ assert.throws(() => loadConfig({ SECURITY_SCREEN_BACKEND: "typo" }), /SECURITY_SCREEN_BACKEND/);
assert.equal(loadConfig({}).securityScreenProxy, undefined);
assert.equal(loadConfig({}).securityScreenTimeoutMs, 15_000);
assert.equal(loadConfig({ SECURITY_SCREEN_TIMEOUT_MS: "25" }).securityScreenTimeoutMs, 25);
diff --git a/test/orchestrator.test.ts b/test/orchestrator.test.ts
index ef2833742..7c0ee90ef 100644
--- a/test/orchestrator.test.ts
+++ b/test/orchestrator.test.ts
@@ -8,7 +8,7 @@ import { buildApp } from "../src/wiring.ts";
import { scopeId, type TurnRequest } from "../src/types.ts";
import { TEST_CAPABILITY_SECRET, testConfig } from "./support/test-config.ts";
import { runNowSettled } from "./support/settle.ts";
-import type { Config } from "../src/config.ts";
+import { loadConfig, type Config } from "../src/config.ts";
import type { ProvisionOptions, Sandbox } from "../src/sandbox/sandbox.ts";
import { verifyCapabilityToken, EGRESS_PROXY_AUD } from "../src/auth/capability-token.ts";
import { egressClaimAllowingControlPlane } from "../src/core/orchestrator.ts";
@@ -2698,6 +2698,7 @@ test("an enforced proxy outage fails open and audits the configured provider", a
(entry) => entry.action === "security_screen.classify" && entry.status === "error",
);
assert.equal(event?.resource, "example-screen");
+ assert.equal(built.modelGateway.audit().filter((rec) => rec.model === "mock-security").length, 0);
});
test("Auto fails open on vision attachments it cannot screen, flagging them unscreened to the model", async () => {
@@ -3865,3 +3866,26 @@ test("activated resource defaults preserve an existing computer and stop eager p
assert.equal(await built.sandboxResources.resolve("personal:new-user"), null);
assert.equal(boxes.provisioned, 1);
});
+
+test("default screening does not invoke a model for inbound data or tool results", async () => {
+ const built = freshApp({ securityScreenBackend: loadConfig({}).securityScreenBackend });
+ let captured: ProvisionOptions | undefined;
+ const provision = built.sandbox.provision.bind(built.sandbox);
+ built.sandbox.provision = (layers, options) => {
+ captured = options;
+ return provision(layers, options);
+ };
+ const result = await built.app.turn(
+ dm("!run printf screening-default-ok", {
+ surface: "webhook",
+ triggered: true,
+ securityScreenData: "ordinary external event",
+ }),
+ );
+ assert.equal(result.status, "ok");
+ assert.match(result.reply ?? "", /screening-default-ok/);
+ assert.equal(built.screenSecurity, undefined);
+ const claims = await verifyCapabilityToken(captured!.egressToken!, TEST_CAPABILITY_SECRET);
+ assert.equal(claims?.egress?.denyPrivateNetworks, true);
+ assert.equal(built.modelGateway.audit().filter((rec) => rec.model === "mock-security").length, 0);
+});
diff --git a/test/resolution.test.ts b/test/resolution.test.ts
index 8cfbaa764..f4cd313bc 100644
--- a/test/resolution.test.ts
+++ b/test/resolution.test.ts
@@ -95,6 +95,7 @@ test("resolution carries the durable effective security posture", async () => {
const resolved = await res.resolve(conv, actor);
assert.deepEqual(resolved.securityPolicy, {
inboundScreening: "off",
+ denyPrivateNetworks: false,
toolApprovals: "all",
});
assert.deepEqual(resolved.approvalGrantModes, { session: true, always: true }, "grant modes default to all-on");
@@ -116,3 +117,22 @@ test("resolution refreshes security config written by another instance", async (
assert.match(resolved.systemPrompt, /FLEET_LIVE/);
assert.deepEqual(resolved.egress.deniedHosts, ["blocked.example"]);
});
+
+test("disabling screening preserves strict tool approvals and scoped posture", async () => {
+ const config = createMemoryConfigStore("default-org");
+ const res = createResolutionService("default-org", config, createAclStore(), false);
+ const conv: Conversation = { kind: "dm", threadRef: "dm:U1:t1", audience: [actor] };
+ await config.setSecurityPosture(scopeId("org", "default-org"), "auto");
+ assert.deepEqual((await res.resolve(conv, actor)).securityPolicy, {
+ inboundScreening: "off",
+ toolApprovals: "none",
+ denyPrivateNetworks: true,
+ });
+ await config.setSecurityPosture(scopeId("personal", "U1"), "strict");
+ assert.deepEqual((await res.resolve(conv, actor)).securityPolicy, {
+ inboundScreening: "off",
+ toolApprovals: "all",
+ denyPrivateNetworks: false,
+ });
+ assert.equal(await config.getSecurityPostureDurable(scopeId("personal", "U1")), "strict");
+});
diff --git a/test/security-posture.test.ts b/test/security-posture.test.ts
index 309408d44..bdfb680f0 100644
--- a/test/security-posture.test.ts
+++ b/test/security-posture.test.ts
@@ -37,14 +37,17 @@ test("narrower scopes may tighten but cannot weaken the org posture", () => {
test("each posture resolves to exactly one mechanism", () => {
assert.deepEqual(resolveSecurityPolicy("dangerous"), {
inboundScreening: "off",
+ denyPrivateNetworks: false,
toolApprovals: "none",
});
assert.deepEqual(resolveSecurityPolicy("auto"), {
inboundScreening: "external",
+ denyPrivateNetworks: true,
toolApprovals: "none",
});
assert.deepEqual(resolveSecurityPolicy("strict"), {
inboundScreening: "off",
+ denyPrivateNetworks: false,
toolApprovals: "all",
});
});
diff --git a/test/sharing-context-e2e.test.ts b/test/sharing-context-e2e.test.ts
index beaf2afa0..81365f8cd 100644
--- a/test/sharing-context-e2e.test.ts
+++ b/test/sharing-context-e2e.test.ts
@@ -380,3 +380,11 @@ test("sharing e2e: complete notebooks retain provenance without truncating late
assert.match(p, /### channel:C1[\s\S]*ROOM_FACT_END/);
assert.match(await b.turn("!memorysearch PERSONAL_FACT_119", true), /\[personal:U1\].*PERSONAL_FACT_119/);
});
+
+test("sharing e2e: screening off preserves carried skills without model calls", async (t) => {
+ const b = await fixture(t, { securityScreenBackend: "off" });
+ await b.skill("personal:U1", "unscreened-helper", "SHARED_SKILL_OK");
+ await b.turn("!read skills/unscreened-helper/SKILL.md", true);
+ assert.equal(await b.turn("!run python3 skills/unscreened-helper/scripts/value.py", true), "SHARED_SKILL_OK");
+ assert.equal(b.modelGateway.audit().filter((rec) => rec.model === "mock-security").length, 0);
+});
diff --git a/test/support/test-config.ts b/test/support/test-config.ts
index bea5d7d7b..ff2986286 100644
--- a/test/support/test-config.ts
+++ b/test/support/test-config.ts
@@ -8,6 +8,7 @@ export const TEST_CAPABILITY_SECRET = "test-capability-key-distinct-from-ingress
export function testConfig(overrides: Partial<Config> = {}): Config {
return {
...loadConfig({}),
+ securityScreenBackend: "model",
port: 0,
pluginSkillDirs: [],
memoryCaptureQuietMs: 0,
diff --git a/test/wake-steering.test.ts b/test/wake-steering.test.ts
index b72b95bd1..a44d31782 100644
--- a/test/wake-steering.test.ts
+++ b/test/wake-steering.test.ts
@@ -785,3 +785,15 @@ test("steer path: a message whose run goes terminal mid-send is replayed and the
"the raced signal was consumed by the inline drain",
);
});
+
+test("screening off delivers ambient updates to the existing run without a classifier", async () => {
+ const built = buildApp(testConfig({ securityScreenBackend: "off" }));
+ const first = await built.app.turn(mention("start work", "C-off", "100.1"));
+ const follow = await built.app.turn(overheard("build finished", "C-off", "100.1"));
+ assert.equal(follow.runId, first.runId);
+ const signals = await built.signals.takePending(first.runId!);
+ assert.equal(signals.length, 1);
+ assert.equal(signals[0]!.kind, "steer");
+ assert.match(signals[0]!.text ?? "", /build finished/);
+ assert.equal(built.modelGateway.audit().filter((rec) => rec.model === "mock-security").length, 0);
+});