Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Send on your behalf without a daily limit

milind-soni9071887cc14a
diff --git a/docs/composio.md b/docs/composio.md
index d175ec9eca..8b6e3fe46a 100644
--- a/docs/composio.md
+++ b/docs/composio.md
@@ -203,4 +203,4 @@ A bot with no grant record at all keeps the legacy behavior: every tool on every
Grants are enforced on the real tool names at call time (including batches inside the MULTI_EXECUTE meta-tool), the tool list offered to the model is filtered to the granted set, and every allow/deny writes a decision-log row. Refusals do not enumerate what else is granted. Paired phones see each bot's grants read-only in its profile (What this bot does → App tools); grants are assigned on the computer, never from a phone.
-Connected-app sends also follow the bot's **Permissions → Sending on your behalf** setting at every access level, including Full access. **Ask every time** requires approval for each send regardless of prompt language. **Allow a daily amount** permits automatic sends up to its cap. Reading and drafting do not consume the allowance; opaque app code execution always requires approval because its effects cannot be counted.
+Connected-app sends also follow the bot's **Permissions → Sending on your behalf** setting at every access level, including Full access. **Ask every time** requires approval for each send regardless of prompt language. **Send without asking** lets sends go out on their own, with no daily limit. A Full-access bot with no setting here sends without asking. Reading and drafting are not sends; opaque app code execution always requires approval because its effects cannot be read.
diff --git a/docs/highlevel.md b/docs/highlevel.md
index 372b4d8f90..9668666a91 100644
--- a/docs/highlevel.md
+++ b/docs/highlevel.md
@@ -122,7 +122,7 @@ The same rules as other connected apps, with slug `highlevel`:
(`FORBIDDEN_PATHS`; see **Never** above).
- `tools/list` shows only what the bot may run; a refused call answers the connector scope text ("HighLevel is
read-only for <bot>, and Add note would write to it…") and writes a decision row (`source: connector-scope`).
-- CRM record changes are not messages: no outbound card, no daily allowance; the write scope is the control.
+- CRM record changes are not messages: no outbound card; the write scope is the control.
## Permissions (scopes)
diff --git a/docs/verification/full-access.md b/docs/verification/full-access.md
index db96e97696..2f13418335 100644
--- a/docs/verification/full-access.md
+++ b/docs/verification/full-access.md
@@ -42,9 +42,10 @@ of a real provider's planning quality or authentication.
an existing bot outside the Chief's team scope.
Connected-app sends follow **Sending on your behalf** at Full access:
-**Ask every time** waits for consent and **Allow a daily amount** consumes
-the configured cap. The [Gmail and outbound fixture](gmail-drafts.md) verifies
-both policies, opaque execution, delegation and changes before dispatch.
+**Ask every time** waits for consent, and **Send without asking** or no
+setting at all sends with no daily limit. The
+[Gmail and outbound fixture](gmail-drafts.md) verifies both policies, opaque
+execution, delegation and changes before dispatch.
## Evidence and limits
diff --git a/docs/verification/gmail-drafts.md b/docs/verification/gmail-drafts.md
index 51164ac322..d4716aafe9 100644
--- a/docs/verification/gmail-drafts.md
+++ b/docs/verification/gmail-drafts.md
@@ -3,10 +3,10 @@
In the bot's Permissions settings, choose **Ask every time** under
**Sending on your behalf**. Connected-app sends require consent at every
access level, including Full access, regardless of the prompt's language.
-An Allow applies to the pending call, not later sends. **Allow a daily amount**
-instead authorizes automatic sends up to the configured cap, including at
-Full access. Reading and drafting never consume the allowance. Opaque app
-code execution needs consent because its effects cannot be counted.
+An Allow applies to the pending call, not later sends. **Send without asking**
+instead authorizes automatic sends with no daily limit, as does Full access
+with no setting. Reading and drafting are not sends. Opaque app code
+execution needs consent because its effects cannot be read.
Run the isolated server and bridge regressions:
@@ -22,18 +22,18 @@ Composio at a loopback stand-in. It verifies:
provider untouched; approval releases only that call.
- Spanish, Hindi, French, Japanese and English requests need consent before
the first send, with no draft write or request-wording classification.
-- The daily allowance permits sends at Full access, consumes the cap, and
- refuses further sends after it is exhausted. Explicit draft-and-send
- requests follow the same policy. Sending a draft after a draft write also
- uses the configured policy.
+- Send without asking permits sends at Full access with no card, and a
+ Full-access bot with no setting sends 35 in a row without a refusal or a
+ card. Explicit draft-and-send requests follow the same policy. Sending a
+ draft after a draft write also uses the configured policy.
- The draft tools create one reply draft and update its existing ID while
retaining the Gmail thread. Repeated creation for the same thread within
the originating request is refused, including after delegation and resuming.
Independent requests must still check existing drafts before creating one.
- Delegated and resumed Full-access turns respect each bot's outbound policy.
-- Switching from an allowance to Ask every time while session metadata is
- pending refuses dispatch. Fresh scope checks run before draft reservations,
- so a scope refusal does not consume a creation attempt.
+- Switching from Send without asking to Ask every time while session
+ metadata is pending refuses dispatch. Fresh scope checks run before draft
+ reservations, so a scope refusal does not consume a creation attempt.
The bridge tests verify read-only app grants hide draft writes and native
updates map to GMAIL_UPDATE_DRAFT. The fixture retains its server log and a
@@ -44,6 +44,6 @@ disposable application data is removed on completion.
These checks prove relay enforcement and draft-tool argument mapping. They do
not verify Gmail rendering, Composio's MIME reply headers or a model's ability
to follow natural-language drafting instructions. The relay does not classify
-request wording. A daily allowance authorizes automatic sends; use Ask every
+request wording. Send without asking authorizes automatic sends; use Ask every
time when each send needs review. Draft revisions use the existing draft ID,
not a language-based prohibition on creating drafts.
diff --git a/scripts/testing/trust-controls-ui.e2e.test.ts b/scripts/testing/trust-controls-ui.e2e.test.ts
index e027f83fad..bb249bfd61 100644
--- a/scripts/testing/trust-controls-ui.e2e.test.ts
+++ b/scripts/testing/trust-controls-ui.e2e.test.ts
@@ -74,12 +74,12 @@ describe("trust controls in the real renderer", () => {
expect(profile).toBeDefined();
await ui("click", "--ref", `@${profile![0]}`);
await click("Permissions");
- await click("Allow a daily amount");
- await type("Daily outbound limit", "7");
- await ui("press", "--keys", "Tab");
- await expect.poll(async () => (await saved()).outbound, { timeout: 10_000 }).toEqual({ policy: "allow", dailyCap: 7 });
+ await click("Send without asking");
+ await expect.poll(async () => (await saved()).outbound, { timeout: 10_000 }).toEqual({ policy: "allow" });
+ expect(await evaluate("[...document.querySelectorAll('div')].find(el => el.firstElementChild?.textContent === 'Sending on your behalf')?.querySelectorAll('input').length")).toBe(0);
+ expect(await snapshot()).not.toContain("used today");
await click("Ask every time");
- await expect.poll(async () => (await saved()).outbound, { timeout: 10_000 }).toEqual({ policy: "ask", dailyCap: 7 });
+ await expect.poll(async () => (await saved()).outbound, { timeout: 10_000 }).toEqual({ policy: "ask" });
// Only this page's inventory reads are synthetic; policy writes still
// pass through the real bot queue and server validation.
diff --git a/server/index.test.ts b/server/index.test.ts
index d96af993ca..69bd23a4a4 100644
--- a/server/index.test.ts
+++ b/server/index.test.ts
@@ -12383,7 +12383,7 @@ describe("harness HTTP API", () => {
expect((await api("PATCH", `/api/bots/${bot.id}`, {
composio: true,
connectorTools: { gmail: { tools: ["GMAIL_SEND_EMAIL"] } },
- outbound: { policy: "allow", dailyCap: 10 },
+ outbound: { policy: "allow" },
})).status).toBe(200);
const token = await mintTestCapability(BASE, bot.id, bot.threadId, { kind: "connectors" });
const call = async (frame: unknown, bearer = token) => {
@@ -12447,7 +12447,7 @@ describe("harness HTTP API", () => {
expect((await api("PATCH", `/api/bots/${legacy.id}`, {
composio: true,
approvalMode: "ask",
- outbound: { policy: "allow", dailyCap: 10 },
+ outbound: { policy: "allow" },
})).status).toBe(200);
const legacyToken = await mintTestCapability(BASE, legacy.id, legacy.threadId, { kind: "connectors" });
const legacyCall = await call(
diff --git a/server/index.ts b/server/index.ts
index 2ca4a5bad2..e7348bb64d 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -476,7 +476,6 @@ import { profileRevision, profileSnapshot } from "./profile-revision.ts";
import { flushAllProfileHistory, flushProfileHistory, readHistory, recordProfileChange } from "./profile-versions.ts";
import { TeamMemory, TEAM_MEMORY_KINDS, type TeamMemoryKind } from "./team-memory.ts";
import { describeTool } from "./activity.ts";
-import { OutboundCounts } from "./outbound-counts.ts";
import { OutboundRequestService } from "./outbound-requests.ts";
import { createOutboundHold, OUTBOUND_HOLD_MS, type OutboundHoldAnswer } from "./outbound-hold.ts";
import { connectorCallsIn, outboundCallsIn } from "../shared/outbound.ts";
@@ -9238,8 +9237,7 @@ const teamMemoryRequests = createTeamMemoryRequests({ teamMemory, store, section
const outsideWrites = createOutsideWrites({ store, notify, language: (threadId) => threadLanguage(threadId), decide: (row) => appendDecision(DATA_DIR, row),
writeMemory: (botId, threadId, change) => { const written = botMemoryUpdate(teamHost.layer(botId, threadId), change, { source: memorySourceLabel({ room: store.groupByThread(threadId), task: store.taskByThread(teamHost.baseBotId(botId), threadId), threadId }), aboutMe: null, prefer: null }); return written.ok ? null : written.error; } });
const outboundRequests = new OutboundRequestService();
-const outboundCounts = new OutboundCounts(join(DATA_DIR, "outbound-counts.json"));
-const outboundHold = createOutboundHold({ store, dataDir: DATA_DIR, outboundRequests, outboundCounts, holdMs: OUTBOUND_HOLD_MS, connectorThread, activeGroupTurnForBot, notify });
+const outboundHold = createOutboundHold({ store, dataDir: DATA_DIR, outboundRequests, holdMs: OUTBOUND_HOLD_MS, connectorThread, activeGroupTurnForBot, notify });
function resolveAndSendTrust(res: ServerResponse, threadId: string, requestId: string, behavior: "allow" | "deny" | "answer"): boolean {
const remembered = teamMemoryRequests.resolve(threadId, requestId, behavior) ?? outsideWrites.resolve(threadId, requestId, behavior);
@@ -12455,7 +12453,7 @@ ROUTES.push(createComputerRoutes({
claimBoatInventoryRequest, claimManagedBoatMutation, claimManagedVpsMutation, cloudComputerUsed: owner => cloudComputerPower.used(owner),
}));
ROUTES.push(createStatusRoutes({
- store, cfg, outboundCounts,
+ store, cfg,
staticDir: STATIC_DIR,
sharedWorkspaceFullAccessEnabled, adminActivityRecording, configStatus, broadcast, threadShown,
browserEngineInstall: { get: () => browserEngineInstall, set: (install) => { browserEngineInstall = install; } },
@@ -14554,7 +14552,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
}
const opaque = connectorCalls.some(call => call.slug === "COMPOSIO_PROXY_EXECUTE");
if (opaque && currentSender.connectorTools !== undefined) return refuseOutbound("OpenMausBot cannot verify this code against this bot's tool grants. Use a direct app tool.");
- // At Full access a send asks nobody (outbound-hold.ts sets its daily cap). A room turn can run at a Chief's delegated level, which only the room handoff carries.
+ // A room turn can run at a Chief's delegated level, which only the room handoff carries.
const sendsFreely = () => roomTurnLevels.forRequest(internalCapability.threadId, internalCapability.botId,
() => sourceApprovalMode(internalCapability.botId, internalCapability.threadId)) === "full";
const fullAccess = outboundTool !== null && sendsFreely();
@@ -14595,8 +14593,8 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
if (draftReservation) refuseDispatch(draftReservation);
if (outboundTool) {
try {
- outboundHold.reserve({
- bot: fresh, threadId: internalCapability.threadId, tool: outboundTool, calls: outboundCalls, opaque,
+ outboundHold.beforeDispatch({
+ bot: fresh, threadId: internalCapability.threadId, tool: outboundTool, opaque,
fullAccess: fullAccess && sendsFreely(), approved: outboundApproved,
});
} catch (error) {
diff --git a/server/outbound-counts.test.ts b/server/outbound-counts.test.ts
deleted file mode 100644
index 77fe23d795..0000000000
--- a/server/outbound-counts.test.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import { existsSync, mkdirSync, mkdtempSync, renameSync, statSync, writeFileSync } from "node:fs";
-import { tmpdir } from "node:os";
-import { join } from "node:path";
-import { afterEach, beforeEach, describe, expect, it } from "vitest";
-
-import { OutboundCounts } from "./outbound-counts.ts";
-import { removeTempDir } from "./testing/cleanup.ts";
-
-let dir: string;
-const file = () => join(dir, "outbound-counts.json");
-
-beforeEach(() => {
- dir = mkdtempSync(join(tmpdir(), "omb-outbound-"));
-});
-
-afterEach(async () => {
- await removeTempDir(dir);
-});
-
-const morning = new Date(2026, 8, 7, 9, 0);
-const evening = new Date(2026, 8, 7, 23, 30);
-const nextDay = new Date(2026, 8, 8, 0, 10);
-
-describe("OutboundCounts", () => {
- it("reserves a batch before a second request can spend the same slot", () => {
- const counts = new OutboundCounts(file());
- expect(counts.reserve("b1", 1, 1, morning)).toBe(1);
- expect(counts.reserve("b1", 1, 1, morning)).toBeNull();
- expect(new OutboundCounts(file()).today("b1", morning)).toBe(1);
- });
-
- it("propagates a failed write without retaining an uncommitted count", () => {
- const counts = new OutboundCounts(file());
- counts.record("b1", morning);
- renameSync(file(), file() + ".saved");
- mkdirSync(file());
- expect(() => counts.record("b1", morning)).toThrow();
- expect(counts.today("b1", morning)).toBe(1);
- expect(() => new OutboundCounts(file()).record("b1", morning)).toThrow();
- });
-
- it("refuses unreadable persisted counts instead of silently resetting the cap", () => {
- writeFileSync(file(), "{broken");
- expect(() => new OutboundCounts(file()).reserve("b1", 1, 1, morning)).toThrow(/could not be read/);
- });
- it("starts at zero with no file, and counts what is recorded", () => {
- const counts = new OutboundCounts(file());
- expect(existsSync(file())).toBe(false);
- expect(counts.today("b1", morning)).toBe(0);
- expect(counts.record("b1", morning)).toBe(1);
- expect(counts.record("b1", evening)).toBe(2);
- expect(counts.today("b1", evening)).toBe(2);
- });
-
- it("keeps bots apart", () => {
- const counts = new OutboundCounts(file());
- counts.record("b1", morning);
- expect(counts.today("b2", morning)).toBe(0);
- });
-
- it("rolls over at local midnight", () => {
- const counts = new OutboundCounts(file());
- counts.record("b1", evening);
- expect(counts.today("b1", nextDay)).toBe(0);
- expect(counts.record("b1", nextDay)).toBe(1);
- });
-
- it("survives a restart and keeps the file private", () => {
- new OutboundCounts(file()).record("b1", morning);
- const reopened = new OutboundCounts(file());
- expect(reopened.today("b1", morning)).toBe(1);
- if (process.platform !== "win32") expect(statSync(file()).mode & 0o777).toBe(0o600);
- });
-
- it("forgets days other than the one being written, so the file stays small", () => {
- const counts = new OutboundCounts(file());
- counts.record("b1", morning);
- counts.record("b1", nextDay);
- const reopened = new OutboundCounts(file());
- expect(reopened.today("b1", morning)).toBe(0);
- expect(reopened.today("b1", nextDay)).toBe(1);
- });
-});
diff --git a/server/outbound-counts.ts b/server/outbound-counts.ts
deleted file mode 100644
index 7167ec76d8..0000000000
--- a/server/outbound-counts.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { readFileSync } from "node:fs";
-
-import { writeFileAtomic } from "./atomic.ts";
-
-type Stored = Record<string, { day: string; count: number }>;
-
-const dayKey = (date: Date): string =>
- `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
-
-export class OutboundCounts {
- private readonly file: string;
- private stored: Stored;
- private readable = true;
-
- constructor(file: string) {
- this.file = file;
- this.stored = this.load();
- }
-
- private load(): Stored {
- try {
- const value: unknown = JSON.parse(readFileSync(this.file, "utf8"));
- if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("invalid outbound counts");
- const stored: Stored = {};
- for (const [botId, entry] of Object.entries(value as Record<string, unknown>)) {
- if (!entry || typeof entry !== "object") throw new Error("invalid outbound count");
- const { day, count } = entry as { day?: unknown; count?: unknown };
- if (typeof day === "string" && typeof count === "number" && Number.isInteger(count) && count >= 0) {
- stored[botId] = { day, count };
- } else throw new Error("invalid outbound count");
- }
- return stored;
- } catch (error) {
- if ((error as NodeJS.ErrnoException).code !== "ENOENT") this.readable = false;
- return {};
- }
- }
-
- private save(): void {
- writeFileAtomic(this.file, JSON.stringify(this.stored, null, 2), { mode: 0o600 });
- }
-
- today(botId: string, now: Date = new Date()): number {
- if (!this.readable) throw new Error("the daily allowance could not be read");
- const entry = this.stored[botId];
- return entry && entry.day === dayKey(now) ? entry.count : 0;
- }
-
- record(botId: string, now: Date = new Date()): number {
- return this.reserve(botId, 1, Number.MAX_SAFE_INTEGER, now)!;
- }
-
- /** Reserve before any provider await; an uncertain send keeps its slot, since a refund could repeat a delivered send. */
- reserve(botId: string, amount: number, cap: number, now: Date = new Date()): number | null {
- const day = dayKey(now);
- const entry = this.stored[botId];
- const count = this.today(botId, now) + amount;
- if (count > cap) return null;
- this.stored[botId] = { day, count };
- try { this.save(); } catch (error) {
- if (entry) this.stored[botId] = entry;
- else delete this.stored[botId];
- throw error;
- }
- return count;
- }
-}
diff --git a/server/outbound-hold.test.ts b/server/outbound-hold.test.ts
index 6967c5743d..537b1dd2ae 100644
--- a/server/outbound-hold.test.ts
+++ b/server/outbound-hold.test.ts
@@ -6,7 +6,6 @@ import { afterEach, describe, expect, it, vi } from "vitest";
import type { Notification } from "../shared/notification.ts";
import { flushDecisionLog, readDecisions } from "./decision-log.ts";
-import { OutboundCounts } from "./outbound-counts.ts";
import { createOutboundHold, type OutboundHold, type OutboundHoldDeps } from "./outbound-hold.ts";
import { OutboundRequestService } from "./outbound-requests.ts";
@@ -50,12 +49,10 @@ function setup(bot: HoldBot) {
taskByThread: () => ({ busy: true }),
};
const outboundRequests = new OutboundRequestService();
- const outboundCounts = new OutboundCounts(join(dataDir, "outbound-counts.json"));
const deps: OutboundHoldDeps = {
store: store as unknown as OutboundHoldDeps["store"],
dataDir,
outboundRequests,
- outboundCounts,
holdMs: 1_000,
connectorThread: () => ({ group: undefined }),
activeGroupTurnForBot: () => null,
@@ -67,28 +64,36 @@ function setup(bot: HoldBot) {
const bot = (outbound: HoldBot["outbound"], notifications = true): HoldBot => ({ id: "b1", name: "Scout", color: "green", outbound, notifications });
-describe("createOutboundHold", () => {
- it("allow policy under the cap approves without a card and records the row", async () => {
- const { hold, dataDir, appended, notified, input } = setup(bot({ policy: "allow", dailyCap: 2 }));
- await expect(hold.hold({ ...input, active: () => true })).resolves.toEqual({ ok: true, approved: false });
- expect(appended).toEqual([]);
- expect(notified).toEqual([]);
+/** One send as the relay makes it: the hold, then the check at dispatch. */
+const send = async (held: ReturnType<typeof setup>, options: { fullAccess?: boolean; opaque?: boolean } = {}) => {
+ const input = { ...held.input, ...options };
+ const answer = await held.hold.hold({ ...input, active: () => true });
+ if (answer.ok) held.hold.beforeDispatch({ ...input, approved: answer.approved });
+ return answer;
+};
- hold.reserve({ ...input, approved: false });
- hold.reserve({ ...input, approved: false });
- expect(() => hold.reserve({ ...input, approved: false })).toThrow(/daily outbound limit/);
+describe("createOutboundHold", () => {
+ it("Send without asking sends 40 in a day with no card and no refusal, and records each one", async () => {
+ const held = setup(bot({ policy: "allow" }));
+ for (let sent = 0; sent < 40; sent++) await expect(send(held)).resolves.toEqual({ ok: true, approved: false });
+ expect(held.appended).toEqual([]);
+ expect(held.notified).toEqual([]);
- await flushDecisionLog(dataDir);
- const rows = readDecisions(dataDir, 10);
- expect(rows.map((row) => row.rule)).toEqual(["daily-allowance:1/2", "daily-allowance:2/2"]);
- expect(rows[0]).toMatchObject({ threadId: "t1", botId: "b1", botName: "Scout", tool: "GMAIL_SEND_EMAIL", decision: "auto-approved", source: "outbound" });
+ await flushDecisionLog(held.dataDir);
+ const rows = readDecisions(held.dataDir, 100);
+ expect(rows).toHaveLength(40);
+ expect(rows.every((row) => row.decision === "auto-approved" && row.source === "outbound" && row.rule === "allow")).toBe(true);
+ expect(rows[0]).toMatchObject({ threadId: "t1", botId: "b1", botName: "Scout", tool: "GMAIL_SEND_EMAIL" });
+ });
- // The cap is spent: the next hold refuses before any card.
- await expect(hold.hold({ ...input, active: () => true })).resolves.toMatchObject({ ok: false, text: expect.stringMatching(/daily limit of 2 outbound actions/) });
+ it("ignores a daily cap an older app stored on the rule", async () => {
+ const held = setup(bot({ policy: "allow", dailyCap: 2 } as HoldBot["outbound"]));
+ for (let sent = 0; sent < 5; sent++) await expect(send(held)).resolves.toEqual({ ok: true, approved: false });
+ expect(held.appended).toEqual([]);
});
it("ask policy posts the card and resolves on allow", async () => {
- const { hold, dataDir, appended, activity, notified, outboundRequests, input } = setup(bot({ policy: "ask", dailyCap: 10 }));
+ const { hold, dataDir, appended, activity, notified, outboundRequests, input } = setup(bot({ policy: "ask" }));
const pending = hold.hold({ ...input, active: () => true });
expect(appended).toHaveLength(1);
@@ -117,11 +122,10 @@ describe("createOutboundHold", () => {
await flushDecisionLog(dataDir);
expect(readDecisions(dataDir, 10)).toMatchObject([{ requestId, decision: "card-shown", source: "outbound", tool: "GMAIL_SEND_EMAIL" }]);
- // An approved hold lets the dispatch through without spending the allowance.
- expect(() => hold.reserve({ ...input, bot: bot({ policy: "ask", dailyCap: 10 }), approved: true })).not.toThrow();
+ expect(() => hold.beforeDispatch({ ...input, bot: bot({ policy: "ask" }), approved: true })).not.toThrow();
// A bot the user muted still posts the card, but sends no notification.
- const muted = setup(bot({ policy: "ask", dailyCap: 10 }, false));
+ const muted = setup(bot({ policy: "ask" }, false));
const mutedPending = muted.hold.hold({ ...muted.input, active: () => true });
expect(muted.appended).toHaveLength(1);
expect(muted.notified).toEqual([null]);
@@ -146,63 +150,47 @@ describe("createOutboundHold", () => {
expect(timed.patches[0]).toMatchObject({ threadId: "t1", messageId: timed.appended[0].message.id, patch: { card: { answered: "unavailable", dismissed: true, title: "Send on your behalf?" } } });
});
- it("reserve refuses when the hold was not approved and the policy is ask", async () => {
- const { hold, input } = setup(bot({ policy: "ask", dailyCap: 10 }));
- expect(() => hold.reserve({ ...input, fullAccess: false, approved: false })).toThrow(/outbound policy changed/);
+ it("refuses at dispatch when the hold was not approved and the policy is ask", async () => {
+ const { hold, input } = setup(bot({ policy: "ask" }));
+ expect(() => hold.beforeDispatch({ ...input, fullAccess: false, approved: false })).toThrow(/outbound policy changed/);
});
});
describe("Full access with no sending rule of its own", () => {
- const send = async (held: ReturnType<typeof setup>) => {
- const answer = await held.hold.hold({ ...held.input, fullAccess: true, active: () => true });
- if (answer.ok) held.hold.reserve({ ...held.input, fullAccess: true, approved: answer.approved });
- return answer;
- };
-
- it("sends 25 a day without a card and refuses the 26th, sending nothing", async () => {
+ it("sends 40 in a day without a card or a refusal", async () => {
const held = setup(bot(undefined));
- for (let sent = 0; sent < 25; sent++) await expect(send(held)).resolves.toEqual({ ok: true, approved: false });
- await expect(send(held)).resolves.toEqual({ ok: false, text: expect.stringMatching(/did not send this\. Scout has reached its daily limit of 25 outbound actions at Full access\. Tell the user it was not sent/) });
+ for (let sent = 0; sent < 40; sent++) await expect(send(held, { fullAccess: true })).resolves.toEqual({ ok: true, approved: false });
expect(held.appended, "never a card").toEqual([]);
expect(held.notified).toEqual([]);
expect(held.outboundRequests.pending("t1")).toEqual([]);
- // A send that passed the hold just before the 25th was spent is still stopped at dispatch.
- expect(() => held.hold.reserve({ ...held.input, fullAccess: true, approved: false })).toThrow(/daily outbound limit\. Nothing was sent/);
await flushDecisionLog(held.dataDir);
const rules = readDecisions(held.dataDir, 100).map((row) => row.rule);
- expect(rules[0]).toBe("full-access:1/25");
- expect(rules[24]).toBe("full-access:25/25");
- expect(rules[25]).toBe("full-access-cap:25");
- });
-
- it("starts the count again the next day", async () => {
- vi.useFakeTimers({ toFake: ["Date"] });
- vi.setSystemTime(new Date(2026, 10, 4, 23, 30));
- const held = setup(bot(undefined));
- for (let sent = 0; sent < 25; sent++) await send(held);
- await expect(send(held)).resolves.toMatchObject({ ok: false });
- vi.setSystemTime(new Date(2026, 10, 5, 0, 5));
- await expect(send(held)).resolves.toEqual({ ok: true, approved: false });
- await flushDecisionLog(held.dataDir);
- expect(readDecisions(held.dataDir, 100).map((row) => row.rule).at(-1)).toBe("full-access:1/25");
+ expect(rules).toEqual(Array(40).fill("full-access"));
});
- it("keeps a stored rule exactly as set: ask still asks, allow keeps its own cap", async () => {
- const asking = setup(bot({ policy: "ask", dailyCap: 100 }));
- const pending = asking.hold.hold({ ...asking.input, fullAccess: true, active: () => true });
- expect(asking.appended).toHaveLength(1);
- asking.outboundRequests.resolve({ threadId: "t1", requestId: asking.appended[0].message.card!.requestId as string, behavior: "allow" });
- await expect(pending).resolves.toEqual({ ok: true, approved: true });
-
- const allowing = setup(bot({ policy: "allow", dailyCap: 30 }));
- for (let sent = 0; sent < 30; sent++) await expect(send(allowing)).resolves.toEqual({ ok: true, approved: false });
- await expect(send(allowing)).resolves.toEqual({ ok: false, text: expect.stringMatching(/daily limit of 30 outbound actions\. Tell the user it was not sent, and ask them to raise the limit/) });
+ it("keeps a stored rule exactly as set: ask still asks, allow sends without asking", async () => {
+ const asking = setup(bot({ policy: "ask" }));
+ for (let round = 0; round < 3; round++) {
+ const pending = send(asking, { fullAccess: true });
+ expect(asking.appended).toHaveLength(round + 1);
+ asking.outboundRequests.resolve({ threadId: "t1", requestId: asking.appended[round].message.card!.requestId as string, behavior: "allow" });
+ await expect(pending).resolves.toEqual({ ok: true, approved: true });
+ }
+
+ const allowing = setup(bot({ policy: "allow" }));
+ for (let sent = 0; sent < 40; sent++) await expect(send(allowing, { fullAccess: true })).resolves.toEqual({ ok: true, approved: false });
+ expect(allowing.appended).toEqual([]);
});
- it("counts a call it cannot inspect too, and never turns it into a card", async () => {
+ it("sends a call it cannot inspect without a card, while Send without asking still asks for one", async () => {
const held = setup(bot(undefined));
- for (let sent = 0; sent < 25; sent++) await held.hold.hold({ ...held.input, opaque: true, fullAccess: true, active: () => true }).then((answer) => answer.ok && held.hold.reserve({ ...held.input, opaque: true, fullAccess: true, approved: false }));
- await expect(held.hold.hold({ ...held.input, opaque: true, fullAccess: true, active: () => true })).resolves.toMatchObject({ ok: false });
+ for (let sent = 0; sent < 30; sent++) await expect(send(held, { fullAccess: true, opaque: true })).resolves.toEqual({ ok: true, approved: false });
expect(held.appended).toEqual([]);
+
+ const allowing = setup(bot({ policy: "allow" }));
+ const pending = allowing.hold.hold({ ...allowing.input, opaque: true, fullAccess: true, active: () => true });
+ expect(allowing.appended).toHaveLength(1);
+ allowing.outboundRequests.resolve({ threadId: "t1", requestId: allowing.appended[0].message.card!.requestId as string, behavior: "deny" });
+ await expect(pending).resolves.toMatchObject({ ok: false });
});
});
diff --git a/server/outbound-hold.ts b/server/outbound-hold.ts
index 0aa9ccc1f1..4ef369762d 100644
--- a/server/outbound-hold.ts
+++ b/server/outbound-hold.ts
@@ -1,10 +1,9 @@
import type { ConnectorCall, OutboundPolicy } from "../shared/outbound.ts";
-import { DEFAULT_OUTBOUND_POLICY, OUTBOUND_DEFAULT_CAP } from "../shared/outbound.ts";
+import { DEFAULT_OUTBOUND_POLICY } from "../shared/outbound.ts";
import type { Notification } from "../shared/notification.ts";
import { HELD_NOTE } from "./auto-approve.ts";
import { appendDecision } from "./decision-log.ts";
import { buildNotification } from "./notify.ts";
-import type { OutboundCounts } from "./outbound-counts.ts";
import type { OutboundRequestService } from "./outbound-requests.ts";
import { outboundCard } from "./outbound-requests.ts";
import type { BotRecord, GroupRecord, Store } from "./store.ts";
@@ -20,7 +19,6 @@ export interface OutboundHoldDeps {
store: Pick<Store, "appendMessage" | "bot" | "messagesFor" | "patchMessage" | "setActivity" | "setTaskActivity" | "taskByThread">;
dataDir: string;
outboundRequests: OutboundRequestService;
- outboundCounts: OutboundCounts;
/** How long a "Send on your behalf?" card waits before it times out. */
holdMs: number;
connectorThread: (botId: string, threadId: string) => { group?: GroupRecord } | null;
@@ -30,45 +28,30 @@ export interface OutboundHoldDeps {
export type OutboundHoldAnswer = { ok: true; approved: boolean } | { ok: false; text: string };
-/** How many sends a day go out on their own, or null when each waits on the card. At Full access a bot with no sending
- * rule of its own sends without asking, up to the default cap; a stored rule is kept exactly as set. */
-function outboundDailyCap(rule: OutboundPolicy | undefined, fullAccess: boolean, opaque: boolean): { cap: number; fullAccess: boolean } | null {
- if (fullAccess && rule === undefined) return { cap: OUTBOUND_DEFAULT_CAP, fullAccess: true };
- const policy = rule ?? DEFAULT_OUTBOUND_POLICY;
- return policy.policy === "allow" && !opaque ? { cap: policy.dailyCap, fullAccess: false } : null;
+/** The rule a send goes out under without the card, or null when it waits on the card. At Full access a bot with no
+ * sending rule of its own sends without asking; a stored rule is kept exactly as set. */
+function sendsWithoutAsking(rule: OutboundPolicy | undefined, fullAccess: boolean, opaque: boolean): "full-access" | "allow" | null {
+ if (fullAccess && rule === undefined) return "full-access";
+ return (rule ?? DEFAULT_OUTBOUND_POLICY).policy === "allow" && !opaque ? "allow" : null;
}
export interface OutboundHold {
- /** A send spends the day's allowance (Full access with no rule of its own, or "allow") or waits on the "Send on your behalf?" card. `fullAccess`: the turn runs at Full access. */
+ /** A send goes out without asking (Full access with no rule of its own, or "allow") or waits on the "Send on your behalf?" card. `fullAccess`: the turn runs at Full access. */
hold(input: { bot: OutboundHoldBot; threadId: string; tool: string; calls: ConnectorCall[]; opaque: boolean; fullAccess: boolean; active: () => boolean }): Promise<OutboundHoldAnswer>;
- /** At dispatch time: a send with an allowance reserves against its cap; otherwise the hold must have been approved. Throws the refusal text. */
- reserve(input: { bot: OutboundHoldBot; threadId: string; tool: string; calls: ConnectorCall[]; opaque: boolean; fullAccess: boolean; approved: boolean }): void;
+ /** At dispatch time, against the bot as it is now: a send that needs no card is recorded; otherwise the hold must have been approved. Throws the refusal text. */
+ beforeDispatch(input: { bot: OutboundHoldBot; threadId: string; tool: string; opaque: boolean; fullAccess: boolean; approved: boolean }): void;
}
export function createOutboundHold(deps: OutboundHoldDeps): OutboundHold {
- const { store, outboundRequests, outboundCounts, connectorThread, activeGroupTurnForBot, notify } = deps;
+ const { store, outboundRequests, connectorThread, activeGroupTurnForBot, notify } = deps;
const DATA_DIR = deps.dataDir;
const { holdMs } = deps;
return {
async hold({ bot: currentSender, threadId, tool: outboundTool, calls: outboundCalls, opaque, fullAccess, active }) {
const refuseOutbound = (text: string): OutboundHoldAnswer => ({ ok: false, text });
- const allowance = outboundDailyCap(currentSender.outbound, fullAccess, opaque);
- const { app, calls, summary } = outboundCard(outboundCalls);
- const capNote = (count: number, full: boolean) =>
- `OpenMausBot did not send this. ${currentSender.name} has reached its daily limit of ${count} outbound action${count === 1 ? "" : "s"}${full ? " at Full access" : ""}. Tell the user it was not sent, and ask them to ${full ? "set a sending rule" : "raise the limit"} under the bot's Permissions before trying again.`;
- if (allowance) {
- let today: number;
- try { today = outboundCounts.today(currentSender.id); }
- catch { return refuseOutbound("OpenMausBot did not send this: the daily allowance could not be read. Nothing was sent."); }
- if (today + outboundCalls.length > allowance.cap) {
- appendDecision(DATA_DIR, {
- threadId, botId: currentSender.id, botName: currentSender.name,
- tool: outboundTool, summary, decision: "auto-denied", source: "outbound", rule: `${allowance.fullAccess ? "full-access-cap" : "daily-cap"}:${allowance.cap}`,
- });
- return refuseOutbound(capNote(allowance.cap, allowance.fullAccess));
- }
- } else {
+ if (!sendsWithoutAsking(currentSender.outbound, fullAccess, opaque)) {
+ const { app, calls, summary } = outboundCard(outboundCalls);
const owner = connectorThread(currentSender.id, threadId);
const held = outboundRequests.open({ botId: currentSender.id, threadId, tool: outboundTool, timeoutMs: holdMs });
const card = store.appendMessage(threadId, {
@@ -123,20 +106,12 @@ export function createOutboundHold(deps: OutboundHoldDeps): OutboundHold {
}
return { ok: true, approved: false };
},
- reserve({ bot: fresh, threadId, tool: outboundTool, calls: outboundCalls, opaque, fullAccess, approved: outboundApproved }) {
- const refuseDispatch: (text: string) => never = (text) => {
- throw new Error(text);
- };
- const allowance = outboundDailyCap(fresh.outbound, fullAccess, opaque);
- if (allowance) {
- let reserved: number | null;
- try { reserved = outboundCounts.reserve(fresh.id, outboundCalls.length, allowance.cap); }
- catch { refuseDispatch("The daily allowance could not be saved. Nothing was sent."); }
- if (reserved === null) refuseDispatch("This bot has reached its daily outbound limit. Nothing was sent.");
- appendDecision(DATA_DIR, { threadId, botId: fresh.id, botName: fresh.name,
- tool: outboundTool, decision: "auto-approved", source: "outbound", rule: `${allowance.fullAccess ? "full-access" : "daily-allowance"}:${reserved}/${allowance.cap}` });
- } else if (!outboundApproved) {
- refuseDispatch("The outbound policy changed. Ask for approval again before sending.");
+ beforeDispatch({ bot: fresh, threadId, tool: outboundTool, opaque, fullAccess, approved }) {
+ const rule = sendsWithoutAsking(fresh.outbound, fullAccess, opaque);
+ if (rule) {
+ appendDecision(DATA_DIR, { threadId, botId: fresh.id, botName: fresh.name, tool: outboundTool, decision: "auto-approved", source: "outbound", rule });
+ } else if (!approved) {
+ throw new Error("The outbound policy changed. Ask for approval again before sending.");
}
},
};
diff --git a/server/routes/bot-patch.ts b/server/routes/bot-patch.ts
index 1da99a0ec7..439d7df0d7 100644
--- a/server/routes/bot-patch.ts
+++ b/server/routes/bot-patch.ts
@@ -263,7 +263,7 @@ export function createBotPatchRoutes(deps: BotPatchRouteDeps): RouteHandler {
}
if (body.outbound !== undefined) {
const policy = normalizeOutboundPolicy(body.outbound);
- if (!policy) return json(res, 400, { error: "outbound must be { policy: ask | allow, dailyCap: 1..1000 }" });
+ if (!policy) return json(res, 400, { error: "outbound must be { policy: ask | allow }" });
patch.outbound = policy;
}
if (body.composio !== undefined) {
@@ -600,8 +600,7 @@ export function createBotPatchRoutes(deps: BotPatchRouteDeps): RouteHandler {
// the bot they constrain. An originless, session-less loopback caller may loosen only while every bot is idle.
const loosened: string[] = [];
const trustPatch = patch as Pick<Partial<BotRecord>, "outbound" | "connectorScopes" | "fallback">;
- if (body.outbound !== undefined && trustPatch.outbound?.policy === "allow" &&
- (existingBot?.outbound?.policy !== "allow" || trustPatch.outbound.dailyCap > existingBot.outbound.dailyCap)) loosened.push("outbound");
+ if (body.outbound !== undefined && trustPatch.outbound?.policy === "allow" && existingBot?.outbound?.policy !== "allow") loosened.push("outbound");
if (body.connectorScopes !== undefined && existingBot?.connectorScopes &&
(!trustPatch.connectorScopes || Object.entries(trustPatch.connectorScopes.apps).some(([slug, scope]) =>
!existingBot.connectorScopes!.apps[slug] || (scope === "write" && existingBot.connectorScopes!.apps[slug] === "read")))) loosened.push("connectorScopes");
diff --git a/server/routes/status.ts b/server/routes/status.ts
index 32827b27c5..f71ddd37f8 100644
--- a/server/routes/status.ts
+++ b/server/routes/status.ts
@@ -1,4 +1,3 @@
-import { DEFAULT_OUTBOUND_POLICY } from "../../shared/outbound.ts";
import { readBotActivity } from "../activity.ts";
import { activityCsv, activityEntries, parseActivityWhat, readAdminActivityRange } from "../admin-activity.ts";
import { loadBrand } from "../brand.ts";
@@ -9,7 +8,6 @@ import { flushNativeLog } from "../drivers/native.ts";
import { editionForMembers, editionStatus, entitled } from "../enterprise.ts";
import { fleetAvailable, fleetRequest, fleetSocketPath } from "../fleet-client.ts";
import { noteKeyAccepted, noteKeyRejected } from "../key-rejections.ts";
-import type { OutboundCounts } from "../outbound-counts.ts";
import { loadPlanUsage, planAccountsFromInstances } from "../plan-usage.ts";
import { tregProviderApi } from "../included-services.ts";
import { checkProviderKey, PROVIDER_KEY_KINDS, providerBaseUrl, type ProviderKeyKind } from "../provider-key-check.ts";
@@ -24,7 +22,6 @@ import { PASS, type RouteHandler } from "./table.ts";
export interface StatusRouteDeps {
store: Pick<Store, "bot" | "bots" | "tasks" | "groupByThread">;
cfg: AppConfig;
- outboundCounts: Pick<OutboundCounts, "today">;
staticDir: string | null;
sharedWorkspaceFullAccessEnabled(): boolean;
adminActivityRecording(): boolean;
@@ -44,7 +41,7 @@ function readable(rows: DecisionRow[], shown: (threadId: string) => boolean): De
export function createStatusRoutes(deps: StatusRouteDeps): RouteHandler {
const {
- store, cfg, outboundCounts, staticDir: STATIC_DIR, sharedWorkspaceFullAccessEnabled, adminActivityRecording,
+ store, cfg, staticDir: STATIC_DIR, sharedWorkspaceFullAccessEnabled, adminActivityRecording,
configStatus, broadcast, browserEngineInstall, browserEngineInstallError,
} = deps;
return async ({ req, res, url, path, method, auth, json, readBody }) => {
@@ -241,13 +238,6 @@ export function createStatusRoutes(deps: StatusRouteDeps): RouteHandler {
rows: readBotActivity({ dataDir: DATA_DIR, eventsDir: EVENTS_DIR, botId: bot.id, threadIds, limit: parsedLimit ?? 300 }),
});
}
-
- m = path.match(/^\/api\/bots\/([\w-]+)\/outbound$/);
- if (m && method === "GET") {
- const bot = store.bot(m[1]);
- if (!bot) return json(res, 404, { error: "no such bot" });
- return json(res, 200, { policy: bot.outbound ?? DEFAULT_OUTBOUND_POLICY, today: outboundCounts.today(bot.id) });
- }
return PASS;
};
}
diff --git a/server/store.ts b/server/store.ts
index ada2b32ea8..2721deaf12 100644
--- a/server/store.ts
+++ b/server/store.ts
@@ -4,7 +4,7 @@ import { join } from "node:path"; import { isDeepStrictEqual } from "node:util";
import { OwnedFile, writeFileAtomic } from "./atomic.ts"; import { saveSoon } from "./save-batch.ts"; import { discardNativeLog } from "./drivers/native.ts";
import { commitRegistryChange, keptRevocation, saveRegistryFor, touchesPermissions } from "./registry-save.ts";
import { parseToolScope, toolScopeWidens } from "../shared/tool-scope.ts"; import { grantScopedApps } from "../shared/connector-scopes.ts";
-import { reorderStable } from "../shared/bot-order.ts";
+import { reorderStable } from "../shared/bot-order.ts"; import { trimOutboundPolicy } from "../shared/outbound.ts";
import { botOwner, chiefConflict, chiefScope, ownerEmail } from "../shared/bot-owner.ts";
import { ensureSections, readSections, changeEmptySection } from "./section-context.ts";
import type { TeamComputers } from "./team-computers.ts";
@@ -336,7 +336,7 @@ export class Store {
for (const b of this.bots) {
if (b.busy || (b.activity !== undefined && b.activity !== "idle")) botsMigrated = true;
b.busy = false;
- b.activity = "idle"; if (grantScopedApps(b)) botsMigrated = true;
+ b.activity = "idle"; if (grantScopedApps(b)) botsMigrated = true; if (trimOutboundPolicy(b)) botsMigrated = true;
if (typeof b.soul !== "string") {
b.soul = "";
botsMigrated = true;
diff --git a/server/trust-controls.e2e.test.ts b/server/trust-controls.e2e.test.ts
index bbdfdc635d..1e1c410882 100644
--- a/server/trust-controls.e2e.test.ts
+++ b/server/trust-controls.e2e.test.ts
@@ -1,5 +1,5 @@
import { spawn, type ChildProcess } from "node:child_process";
-import { closeSync, existsSync, mkdirSync, openSync, readFileSync, renameSync, writeFileSync } from "node:fs";
+import { closeSync, existsSync, openSync, readFileSync, writeFileSync } from "node:fs";
import { createServer, type Server } from "node:http";
import { join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -18,13 +18,11 @@ let fullBot: any;
let draftBot: any;
let draftHelper: any;
let outboundPolicyBot: any;
-let capBot: any;
+let noRuleBot: any;
const gmailDrafts = new Map<string, Record<string, unknown>>();
let brokerOrigin = "";
const relayed: unknown[] = [];
const evidence: unknown[] = [];
-let blockRelay: (() => void) | undefined;
-let relayEntered = false;
let blockSession: (() => void) | undefined;
let sessionEntered = false;
const api = async (method: string, path: string, body?: unknown, token = admin) => {
@@ -90,10 +88,6 @@ beforeAll(async () => {
});
return res.end(JSON.stringify({ jsonrpc: "2.0", id: body.id, result: { content: [{ type: "text", text: JSON.stringify({ successful: true, data: { results } }) }] } }));
}
- if (blockRelay) {
- relayEntered = true;
- await new Promise<void>(resolve => { blockRelay = resolve; });
- }
return res.end(JSON.stringify({ jsonrpc: "2.0", id: body.id, result: { content: [{ type: "text", text: "relay-ok" }] } }));
}
return res.end(JSON.stringify({ items: [{ slug: "gmail", connected_account: { id: "fixture-account", status: "ACTIVE" } }] }));
@@ -115,19 +109,19 @@ beforeAll(async () => {
const policyCreated = await fetch(fixture.info.url + "/api/bots", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ name: "Full outbound policy fixture" }) });
expect(policyCreated.status).toBe(201);
outboundPolicyBot = (await policyCreated.json() as any).bot;
- const capCreated = await fetch(fixture.info.url + "/api/bots", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ name: "Full default cap fixture" }) });
- expect(capCreated.status).toBe(201);
- capBot = (await capCreated.json() as any).bot;
+ const noRuleCreated = await fetch(fixture.info.url + "/api/bots", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ name: "Full no sending rule fixture" }) });
+ expect(noRuleCreated.status).toBe(201);
+ noRuleBot = (await noRuleCreated.json() as any).bot;
await waitForExit(fixture.child, { signal: "SIGTERM" });
const botsFile = join(fixture.info.dataDir, "bots.json");
const bots = JSON.parse(readFileSync(botsFile, "utf8"));
const saved = bots.find((row: any) => row.id === fullBot.id);
- for (const full of [saved, ...[draftBot, draftHelper, outboundPolicyBot, capBot].map(bot => bots.find((row: any) => row.id === bot.id))]) {
+ for (const full of [saved, ...[draftBot, draftHelper, outboundPolicyBot, noRuleBot].map(bot => bots.find((row: any) => row.id === bot.id))]) {
full.approvalMode = "full";
full.autoApprove = false;
for (const task of full.tasks) { task.approvalMode = "full"; task.autoApprove = false; }
}
- // Full access asks only for a bot someone set a sending rule on.
+ // Full access asks only for a bot someone set a sending rule on. These rules carry the daily cap older apps stored.
for (const bot of [fullBot, draftBot, draftHelper, outboundPolicyBot]) bots.find((row: any) => row.id === bot.id).outbound = { policy: "ask", dailyCap: 100 };
writeFileSync(botsFile, JSON.stringify(bots));
const configFile = join(fixture.info.dataDir, "config.json");
@@ -161,7 +155,6 @@ beforeAll(async () => {
}, 40_000);
afterAll(async () => {
- blockRelay?.();
blockSession?.();
const evidencePath = fixture.info.logPath + ".trust-controls.json";
writeFileSync(evidencePath, JSON.stringify({ fixture: fixture.info, evidence, relayed }, null, 2));
@@ -179,13 +172,13 @@ it("keeps activity, shared memory and policy changes admin-only", async () => {
expect((await api("POST", "/api/team-memory?section=", { kind: "term", name: "Denied", detail: "not admin" }, member)).status).toBe(403);
expect((await api("PATCH", "/api/team-memory/fixture?section=", { detail: "not admin" }, member)).status).toBe(403);
expect((await api("DELETE", "/api/team-memory/fixture?section=", undefined, member)).status).toBe(403);
- for (const patch of [{ outbound: { policy: "allow", dailyCap: 100 } }, { connectorScopes: null }, { fallback: [] }]) {
+ for (const patch of [{ outbound: { policy: "allow" } }, { connectorScopes: null }, { fallback: [] }]) {
expect((await api("PATCH", `/api/bots/${b.id}`, patch, member)).status).toBe(403);
}
expect((await api("PATCH", `/api/bots/${b.id}`, { fallback: [{ instanceId: "claude", model: " " }] })).status).toBe(400);
});
-it("honors outbound approval and the daily allowance at Full access, and still refuses apps outside scope", async () => {
+it("honors outbound approval and Send without asking at Full access, and still refuses apps outside scope", async () => {
const b = fullBot;
const fleet = await api("GET", "/api/bots");
expect(fleet.body.bots.find((row: any) => row.id === b.id).approvalMode).toBe("full");
@@ -202,27 +195,28 @@ it("honors outbound approval and the daily allowance at Full access, and still r
await api("POST", `/api/threads/${b.threadId}/respond`, { requestId: allowedCard.card.requestId, behavior: "allow" });
expect((await allowed).body.result.isError).not.toBe(true);
expect(relayed).toHaveLength(before + 1);
- await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 1 } });
+ // An older app still sends the daily cap with the rule: it is accepted, dropped, and limits nothing.
+ expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 1 } })).status).toBe(200);
+ expect((await api("GET", "/api/bots")).body.bots.find((row: any) => row.id === b.id).outbound).toEqual({ policy: "allow" });
const cardCount = (await cards(b.threadId)).filter(row => row.card?.outboundRequest).length;
- expect((await relay(token, "SLACK_SEND_MESSAGE", { channel: "fixture", text: "Allowed once" })).body.result.isError).not.toBe(true);
- expect((await api("GET", `/api/bots/${b.id}/outbound`)).body.today).toBe(1);
- expect((await relay(token, "GMAIL_SEND_EMAIL", { to: "[email protected]" })).body.result.isError).toBe(true);
+ expect((await relay(token, "SLACK_SEND_MESSAGE", { channel: "fixture", text: "Sent without asking" })).body.result.isError).not.toBe(true);
+ expect((await relay(token, "GMAIL_SEND_EMAIL", { to: "[email protected]" })).body.result.isError).not.toBe(true);
expect((await cards(b.threadId)).filter(row => row.card?.outboundRequest)).toHaveLength(cardCount);
const opaque = relay(token, "COMPOSIO_REMOTE_WORKBENCH", { code_to_execute: "print(1)" });
const opaqueCard = await pending(b.threadId);
await api("POST", `/api/threads/${b.threadId}/respond`, { requestId: opaqueCard.card.requestId, behavior: "deny" });
expect((await opaque).body.result.isError).toBe(true);
- expect(relayed).toHaveLength(before + 2);
+ expect(relayed).toHaveLength(before + 3);
await api("PATCH", `/api/bots/${b.id}`, { connectorScopes: { apps: { gmail: "read" } } });
expect((await relay(token, "GMAIL_SEND_EMAIL")).body.result.isError).toBe(true);
- expect(relayed).toHaveLength(before + 2);
+ expect(relayed).toHaveLength(before + 3);
});
it("honors Ask every time at Full access before the first send for any prompt language", async () => {
const b = outboundPolicyBot;
- expect((await api("GET", "/api/bots")).body.bots.find((bot: any) => bot.id === b.id).outbound.policy).toBe("ask");
- expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "invalid", dailyCap: 100 } })).status).toBe(400);
- expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 100 } }, member)).status).toBe(403);
+ expect((await api("GET", "/api/bots")).body.bots.find((bot: any) => bot.id === b.id).outbound).toEqual({ policy: "ask" });
+ expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "invalid" } })).status).toBe(400);
+ expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow" } }, member)).status).toBe(403);
const before = relayed.length;
for (const text of ["Responde a Sam, no lo envíes", "Sam को जवाब लिखो, भेजना मत", "Réponds à Sam sans envoyer", "Samに返信を書いて、送信しないで", "Send the email now"]) {
expect((await api("POST", `/api/bots/${b.id}/messages`, { text, threadId: b.threadId })).status).toBe(202);
@@ -254,9 +248,9 @@ it("honors Ask every time at Full access before the first send for any prompt la
expect((await repeated).body.result.isError).toBe(true);
});
-it("honors the daily allowance for explicit draft-and-send requests without classifying their wording", async () => {
+it("honors Send without asking for explicit draft-and-send requests without classifying their wording", async () => {
const b = outboundPolicyBot;
- expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 100 } })).status).toBe(200);
+ expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow" } })).status).toBe(200);
const before = relayed.length;
const cardCount = (await cards(b.threadId)).filter(row => row.card?.outboundRequest).length;
for (const text of ["Draft a reply to Sam and send it", "Edit the draft to fix the typo and send it", "Write a draft and then send it to the team"]) {
@@ -267,7 +261,7 @@ it("honors the daily allowance for explicit draft-and-send requests without clas
}
expect(relayed).toHaveLength(before + 3);
expect((await cards(b.threadId)).filter(row => row.card?.outboundRequest)).toHaveLength(cardCount);
- expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "ask", dailyCap: 100 } })).status).toBe(200);
+ expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "ask" } })).status).toBe(200);
});
it("holds sends under Ask every time at Full access and revises the same Gmail draft without another creation", async () => {
@@ -304,7 +298,7 @@ it("holds sends under Ask every time at Full access and revises the same Gmail d
expect(gmailDrafts.get(draftId)).toMatchObject({ body: "Revised reply", thread_id: "mega-thread" });
const reached = relayed.slice(before).flatMap((frame: any) => frame.params?.arguments?.tools ?? [{ tool_slug: frame.params?.name }]);
expect(reached.map((tool: any) => tool.tool_slug)).toEqual(["GMAIL_CREATE_EMAIL_DRAFT", "GMAIL_UPDATE_DRAFT"]);
- await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 100 } });
+ await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow" } });
const cardCount = (await cards(b.threadId)).filter(row => row.card?.outboundRequest).length;
expect((await relay(revision, "GMAIL_SEND_DRAFT", { draft_id: draftId })).body.result.isError).not.toBe(true);
expect(relayed).toHaveLength(before + 3);
@@ -315,7 +309,7 @@ it("retains Gmail draft limits through delegated work and the requester's resume
const b = draftBot;
const helper = draftHelper;
for (const bot of [b, helper]) {
- expect((await api("PATCH", `/api/bots/${bot.id}`, { modelSelection: { instanceId: "gmailFixture", model: "claude-sonnet-5" }, threadId: bot.threadId, peers: [b.id, helper.id].filter(id => id !== bot.id), acknowledgePeerScope: true, outbound: { policy: "ask", dailyCap: 100 } })).status).toBe(200);
+ expect((await api("PATCH", `/api/bots/${bot.id}`, { modelSelection: { instanceId: "gmailFixture", model: "claude-sonnet-5" }, threadId: bot.threadId, peers: [b.id, helper.id].filter(id => id !== bot.id), acknowledgePeerScope: true, outbound: { policy: "ask" } })).status).toBe(200);
}
const draft = { thread_id: "continued-thread", recipient_email: "[email protected]", subject: "Re: Continuation", body: "Draft response" };
const write = { server: "composio", tool: "GMAIL_CREATE_EMAIL_DRAFT", arguments: draft };
@@ -354,7 +348,7 @@ it("honors Ask every time on Full-access delegated and resumed turns without rel
const b = outboundPolicyBot;
const helper = draftHelper;
for (const bot of [b, helper]) {
- expect((await api("PATCH", `/api/bots/${bot.id}`, { modelSelection: { instanceId: "gmailFixture", model: "claude-sonnet-5" }, threadId: bot.threadId, peers: [b.id, helper.id].filter(id => id !== bot.id), acknowledgePeerScope: true, outbound: { policy: "ask", dailyCap: 100 } })).status).toBe(200);
+ expect((await api("PATCH", `/api/bots/${bot.id}`, { modelSelection: { instanceId: "gmailFixture", model: "claude-sonnet-5" }, threadId: bot.threadId, peers: [b.id, helper.id].filter(id => id !== bot.id), acknowledgePeerScope: true, outbound: { policy: "ask" } })).status).toBe(200);
}
const send = { server: "composio", tool: "GMAIL_REPLY_TO_THREAD", arguments: { thread_id: "ask-delegation" }, expectError: true };
writeFileSync(join(fixture.info.dataDir, "gmail-plan.json"), JSON.stringify({
@@ -379,31 +373,26 @@ it("honors Ask every time on Full-access delegated and resumed turns without rel
evidence.push({ outboundPolicyDelegation: readFileSync(join(fixture.info.dataDir, "gmail-plan.json.evidence.jsonl"), "utf8") });
}, 90_000);
-it("sends 25 a day at Full access with no sending rule, refuses the 26th, and a routine at the cap reports it with no card", async () => {
- const b = capBot;
+it("sends 35 in a day at Full access with no sending rule, with no refusal and no card, and a routine sends too", async () => {
+ const b = noRuleBot;
const email = (to: string) => ({ recipient_email: to, subject: "Reminder", body: "See you at nine." });
const token = await mint(b.id, b.threadId);
const before = relayed.length;
const sent = () => relayed.slice(before).filter((frame: any) => frame.method === "tools/call").length;
- for (let count = 0; count < 25; count++) expect((await relay(token, "GMAIL_SEND_EMAIL", email(`person${count}@example.test`))).body.result.isError).not.toBe(true);
- expect(sent()).toBe(25);
- expect((await api("GET", `/api/bots/${b.id}/outbound`)).body.today).toBe(25);
- const refused = (await relay(token, "GMAIL_SEND_EMAIL", email("[email protected]"))).body.result;
- expect(refused.isError).toBe(true);
- expect(refused.content[0].text).toMatch(/did not send this\. Full default cap fixture has reached its daily limit of 25 outbound actions at Full access/);
- expect(sent(), "nothing was sent").toBe(25);
+ for (let count = 0; count < 35; count++) expect((await relay(token, "GMAIL_SEND_EMAIL", email(`person${count}@example.test`))).body.result.isError).not.toBe(true);
+ expect(sent()).toBe(35);
expect((await api("PATCH", `/api/bots/${b.id}`, { modelSelection: { instanceId: "gmailFixture", model: "claude-sonnet-5" }, threadId: b.threadId })).status).toBe(200);
writeFileSync(join(fixture.info.dataDir, "gmail-plan.json"), JSON.stringify({ [b.id]: { timeoutMs: 60_000,
- steps: [{ server: "composio", tool: "GMAIL_SEND_EMAIL", arguments: email("[email protected]"), expectError: true }],
- reply: "Report: the reminder was not sent, the daily sending limit is reached." } }));
+ steps: [{ server: "composio", tool: "GMAIL_SEND_EMAIL", arguments: email("[email protected]") }],
+ reply: "Report: the reminder was sent." } }));
const created = await api("POST", "/api/routines", { name: "Morning reminder", prompt: "Send the morning reminder email to the team.", botId: b.id, schedule: { type: "interval", everyMinutes: 1440, anchorAt: Date.now() + 86_400_000 } });
expect(created.status, JSON.stringify(created.body)).toBe(201);
const { run } = (await api("POST", `/api/routines/${created.body.routine.id}/run`)).body;
let finished: any;
await expect.poll(async () => (finished = (await api("GET", "/api/routines")).body.runs.find((item: any) => item.id === run.id))?.status, { timeout: 45_000 }).toBe("completed");
- expect(finished.output).toContain("Report: the reminder was not sent");
- expect(sent()).toBe(25);
+ expect(finished.output).toContain("Report: the reminder was sent.");
+ expect(sent()).toBe(36);
const threads = (await api("GET", "/api/bots")).body.bots.find((bot: any) => bot.id === b.id).tasks.map((task: any) => task.threadId);
for (const thread of threads) expect((await cards(thread)).filter((row: any) => row.card?.outboundRequest), "no card waits on anyone").toEqual([]);
}, 90_000);
@@ -475,7 +464,7 @@ it("does not consume a Gmail draft reservation when the fresh scope check refuse
it("honors Ask every time enabled while a Full-access send is waiting for dispatch", async () => {
const b = fullBot;
- await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 100 }, connectorScopes: { apps: { gmail: "write" } } });
+ await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow" }, connectorScopes: { apps: { gmail: "write" } } });
const token = await mint(b.id, b.threadId);
const before = relayed.length;
sessionEntered = false;
@@ -483,7 +472,7 @@ it("honors Ask every time enabled while a Full-access send is waiting for dispat
const send = relay(token, "GMAIL_SEND_EMAIL", { to: "[email protected]" });
try {
await expect.poll(() => sessionEntered, { timeout: 5_000 }).toBe(true);
- expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "ask", dailyCap: 100 } })).status).toBe(200);
+ expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "ask" } })).status).toBe(200);
await expect.poll(() => JSON.parse(readFileSync(join(fixture.info.dataDir, "bots.json"), "utf8"))
.find((bot: any) => bot.id === b.id).outbound?.policy).toBe("ask");
} finally {
@@ -497,46 +486,28 @@ it("honors Ask every time enabled while a Full-access send is waiting for dispat
expect(relayed).toHaveLength(before);
await api("POST", `/api/threads/${b.threadId}/respond`, { requestId: card.card.requestId, behavior: "deny" });
expect((await nextSend).body.result.isError).toBe(true);
- expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 100 } })).status).toBe(200);
+ expect((await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow" } })).status).toBe(200);
expect((await relay(token, "GMAIL_SEND_EMAIL", { to: "[email protected]" })).body.result.isError).not.toBe(true);
expect(relayed).toHaveLength(before + 1);
});
-it("does not consume the outbound allowance when a duplicate draft refuses a mixed batch", async () => {
+it("sends nothing when a duplicate draft refuses a mixed batch", async () => {
const b = fullBot;
const token = await mint(b.id, b.threadId);
- const draft = { thread_id: "reservation-cap", body: "Review this" };
+ const draft = { thread_id: "duplicate-in-batch", body: "Review this" };
const before = relayed.length;
- const count = (await api("GET", `/api/bots/${b.id}/outbound`)).body.today;
expect((await relay(token, "GMAIL_CREATE_EMAIL_DRAFT", draft)).body.result.isError).not.toBe(true);
const duplicate = await relay(token, "COMPOSIO_MULTI_EXECUTE_TOOL", { tools: [
{ tool_slug: "GMAIL_CREATE_EMAIL_DRAFT", arguments: draft },
{ tool_slug: "GMAIL_SEND_EMAIL", arguments: { to: "[email protected]" } },
] });
expect(duplicate.body.result.isError).toBe(true);
- expect((await api("GET", `/api/bots/${b.id}/outbound`)).body.today).toBe(count);
expect(relayed).toHaveLength(before + 1);
});
-it("reserves a daily slot before provider await, so simultaneous calls cannot overspend", async () => {
- const b = await bot("Concurrent cap");
- await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 1 } });
- const token = await mint(b.id, b.threadId);
- relayEntered = false;
- blockRelay = () => {};
- const first = relay(token, "GMAIL_SEND_EMAIL");
- await expect.poll(() => relayEntered, { timeout: 5_000 }).toBe(true);
- expect((await relay(token, "GMAIL_SEND_EMAIL")).body.result.isError).toBe(true);
- expect((await api("GET", `/api/bots/${b.id}/outbound`)).body.today).toBe(1);
- blockRelay();
- blockRelay = undefined;
- expect((await first).body.result.isError).not.toBe(true);
- expect((await api("GET", `/api/bots/${b.id}/outbound`)).body.today).toBe(1);
-});
-
-it("never treats arbitrary workbench code as a counted daily allowance", async () => {
+it("still asks before arbitrary workbench code under Send without asking", async () => {
const b = await bot("Opaque code");
- await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 1 } });
+ await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow" } });
const token = await mint(b.id, b.threadId);
const before = relayed.length;
const held = relay(token, "COMPOSIO_REMOTE_WORKBENCH", { code_to_execute: 'for x in range(99): run_tool("GMAIL_" + "SEND_EMAIL", {})' });
@@ -662,16 +633,3 @@ it("preserves accounts referenced by a fallback chain before delete or credentia
await api("PATCH", `/api/bots/${b.id}`, { fallback: [] });
expect((await api("DELETE", `/api/instances/${instanceId}`)).status).toBe(200);
});
-
-it("does not relay if the allowance cannot be durably written", async () => {
- const b = await bot("Failed allowance");
- await api("PATCH", `/api/bots/${b.id}`, { outbound: { policy: "allow", dailyCap: 1 } });
- const token = await mint(b.id, b.threadId);
- const file = join(fixture.info.dataDir, "outbound-counts.json");
- renameSync(file, file + ".saved");
- mkdirSync(file);
- const before = relayed.length;
- expect((await relay(token, "GMAIL_SEND_EMAIL")).body.result.isError).toBe(true);
- expect(relayed).toHaveLength(before);
- expect((await api("GET", `/api/bots/${b.id}/outbound`)).body.today).toBe(0);
-});
diff --git a/shared/outbound.test.ts b/shared/outbound.test.ts
index cb622e05e7..fbb447e3cd 100644
--- a/shared/outbound.test.ts
+++ b/shared/outbound.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
-import { OUTBOUND_DEFAULT_CAP, connectorCallsIn, isOutboundTool, isReadOnlyTool, normalizeOutboundPolicy, outboundCallsIn } from "./outbound.ts";
+import { connectorCallsIn, isOutboundTool, isReadOnlyTool, normalizeOutboundPolicy, outboundCallsIn, trimOutboundPolicy } from "./outbound.ts";
describe("isOutboundTool", () => {
it("flags tools that send, reply, post, publish, invite, share, or move money", () => {
@@ -81,21 +81,43 @@ describe("isReadOnlyTool", () => {
});
describe("normalizeOutboundPolicy", () => {
- it("accepts ask and allow with a whole-number daily cap", () => {
- expect(normalizeOutboundPolicy({ policy: "ask" })).toEqual({ policy: "ask", dailyCap: OUTBOUND_DEFAULT_CAP });
- expect(normalizeOutboundPolicy({ policy: "allow", dailyCap: 10 })).toEqual({ policy: "allow", dailyCap: 10 });
+ it("accepts ask and allow, with no limit of any kind", () => {
+ expect(normalizeOutboundPolicy({ policy: "ask" })).toEqual({ policy: "ask" });
+ expect(normalizeOutboundPolicy({ policy: "allow" })).toEqual({ policy: "allow" });
+ });
+
+ it("accepts a rule an older app saved or sends with a daily cap, whatever the cap, and drops it", () => {
+ for (const dailyCap of [10, 0, 2.5, 100_000, "25", null]) {
+ expect(normalizeOutboundPolicy({ policy: "allow", dailyCap })).toEqual({ policy: "allow" });
+ }
+ expect(normalizeOutboundPolicy({ policy: "ask", dailyCap: 25 })).toEqual({ policy: "ask" });
});
it("refuses anything else", () => {
expect(normalizeOutboundPolicy({ policy: "yes" })).toBeNull();
- expect(normalizeOutboundPolicy({ policy: "allow", dailyCap: 0 })).toBeNull();
- expect(normalizeOutboundPolicy({ policy: "allow", dailyCap: 2.5 })).toBeNull();
- expect(normalizeOutboundPolicy({ policy: "allow", dailyCap: 100_000 })).toBeNull();
+ expect(normalizeOutboundPolicy({ dailyCap: 10 })).toBeNull();
expect(normalizeOutboundPolicy("allow")).toBeNull();
expect(normalizeOutboundPolicy(null)).toBeNull();
});
});
+describe("trimOutboundPolicy", () => {
+ it("drops a stored daily cap and says so, once", () => {
+ const bot = { outbound: { policy: "allow", dailyCap: 25 } as never };
+ expect(trimOutboundPolicy(bot)).toBe(true);
+ expect(bot.outbound).toEqual({ policy: "allow" });
+ expect(trimOutboundPolicy(bot)).toBe(false);
+ });
+
+ it("leaves no rule, a current rule and a malformed rule as they are", () => {
+ for (const outbound of [undefined, { policy: "ask" }, { policy: "yes", dailyCap: 25 }] as never[]) {
+ const bot = { outbound };
+ expect(trimOutboundPolicy(bot)).toBe(false);
+ expect(bot.outbound).toBe(outbound);
+ }
+ });
+});
+
describe("connectorCallsIn", () => {
// Composio's session exposes a handful of meta tools; the app tools run
// inside them. The gate has to see through the wrapper or it sees nothing.
diff --git a/shared/outbound.ts b/shared/outbound.ts
index 95f92681b5..dd4292efb4 100644
--- a/shared/outbound.ts
+++ b/shared/outbound.ts
@@ -1,20 +1,15 @@
// Outbound actions: calls that reach a person outside the app or move money.
-// Below Full access they get their own confirmation, or spend an optional daily
-// allowance per bot; at Full access they run, up to OUTBOUND_DEFAULT_CAP a day
-// unless the bot has a rule of its own. A read-and-draft routine run never
-// reaches them: the relay refuses every send there. Shared by the harness (which
-// enforces it) and the app.
+// Below Full access they get their own confirmation unless the bot's rule sends
+// without asking; at Full access they run unless the bot has a rule of its own.
+// A read-and-draft routine run never reaches them: the relay refuses every send
+// there. Shared by the harness (which enforces it) and the app.
import { isConnectedAppsServer } from "./own-apps.ts";
export type OutboundPolicy = {
- /** ask: every outbound call waits for a tap. allow: up to dailyCap a day. */
+ /** ask: every outbound call waits for a tap. allow: outbound calls go out without asking. */
policy: "ask" | "allow";
- dailyCap: number;
};
-export const OUTBOUND_DEFAULT_CAP = 25;
-const OUTBOUND_MAX_CAP = 1_000;
-
/** Tools whose action is one of these words send something somewhere. */
const SEND_VERBS = new Set([
"SEND",
@@ -102,18 +97,24 @@ export function isOutboundTool(name: string): boolean {
return tokens.some((token) => CREATE_VERBS.has(token)) && tokens.some((token) => SENT_NOUNS.has(token));
}
-/** The stored shape, or null when the value is not one. */
+/** The stored shape, or null when the value is not one. Fields other than `policy` are dropped. */
export function normalizeOutboundPolicy(value: unknown): OutboundPolicy | null {
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
- const { policy, dailyCap } = value as { policy?: unknown; dailyCap?: unknown };
- if (policy !== "ask" && policy !== "allow") return null;
- if (dailyCap === undefined) return { policy, dailyCap: OUTBOUND_DEFAULT_CAP };
- if (typeof dailyCap !== "number" || !Number.isInteger(dailyCap) || dailyCap < 1 || dailyCap > OUTBOUND_MAX_CAP) return null;
- return { policy, dailyCap };
+ const { policy } = value as { policy?: unknown };
+ return policy === "ask" || policy === "allow" ? { policy } : null;
}
/** What a bot without a stored policy does: ask, every time. */
-export const DEFAULT_OUTBOUND_POLICY: OutboundPolicy = { policy: "ask", dailyCap: OUTBOUND_DEFAULT_CAP };
+export const DEFAULT_OUTBOUND_POLICY: OutboundPolicy = { policy: "ask" };
+
+/** Drops from a stored bot's rule what `normalizeOutboundPolicy` drops, so every copy of one rule reads the same; true
+ * when it changed. A rule that is not one is left as it is, and asks. */
+export function trimOutboundPolicy(bot: { outbound?: OutboundPolicy }): boolean {
+ const kept = bot.outbound && normalizeOutboundPolicy(bot.outbound);
+ if (!kept || Object.keys(bot.outbound!).length === Object.keys(kept).length) return false;
+ bot.outbound = kept;
+ return true;
+}
/** One app tool a connector request would run, with its arguments when the
* request carries them. */
diff --git a/shared/wire.ts b/shared/wire.ts
index 9303d9fc69..bc87670174 100644
--- a/shared/wire.ts
+++ b/shared/wire.ts
@@ -381,7 +381,7 @@ export interface WireBot extends DefaultBotFields, BotAccessFields {
* none. Grants never travel in shareable exports. */
connectorTools?: Record<string, ConnectorToolGrant>;
connectorScopes?: { apps: Record<string, "read" | "write"> };
- outbound?: { policy: "ask" | "allow"; dailyCap: number };
+ outbound?: { policy: "ask" | "allow" };
/** Which of a paired phone's apps this bot may use; absent: every bot may use what the phone allows (shared/phone-apps.ts). */
phoneApps?: import("./phone-apps.ts").PhoneApps;
/** Ordered backups used only by opt-in, pre-prompt startup recovery. */
diff --git a/src/components/bot-settings/PermissionsSection.test.ts b/src/components/bot-settings/PermissionsSection.test.ts
index ca9f98b5d1..48d1ebafc0 100644
--- a/src/components/bot-settings/PermissionsSection.test.ts
+++ b/src/components/bot-settings/PermissionsSection.test.ts
@@ -122,6 +122,30 @@ describe("PermissionsSection parts", () => {
});
});
+describe("Sending on your behalf", () => {
+ const option = (label: string) => [...host.querySelectorAll("button")].find((candidate) => candidate.textContent === label);
+
+ it("asks every time by default, and one click sends without asking", () => {
+ render(base);
+ expect(option("Ask every time")?.getAttribute("aria-pressed")).toBe("true");
+ flushSync(() => option("Send without asking")!.click());
+ expect(dispatch).toHaveBeenCalledExactlyOnceWith({ type: "updateBot", botId: "pepper", patch: { outbound: { policy: "allow" } } });
+ });
+
+ it("has no limit to set or count, even for a rule saved with a daily cap", () => {
+ const fetched = vi.fn(() => new Promise(() => {}));
+ vi.stubGlobal("fetch", fetched);
+ render({ ...base, outbound: { policy: "allow", dailyCap: 25 } as Bot["outbound"] });
+ expect(option("Send without asking")?.getAttribute("aria-pressed")).toBe("true");
+ expect(host.querySelector("input")).toBeNull();
+ expect(host.textContent).not.toContain("used today");
+ expect(host.textContent).not.toContain("25");
+ expect(fetched).not.toHaveBeenCalled();
+ flushSync(() => option("Ask every time")!.click());
+ expect(dispatch).toHaveBeenCalledExactlyOnceWith({ type: "updateBot", botId: "pepper", patch: { outbound: { policy: "ask" } } });
+ });
+});
+
describe("who a bot talks to", () => {
const quill: Bot = { ...base, id: "quill", name: "Quill", threadId: "quill-main", tasks: [] };
const button = () => [...host.querySelectorAll("button")].find((candidate) => candidate.textContent === "Let it talk to every bot");
diff --git a/src/components/bot-settings/PermissionsSection.tsx b/src/components/bot-settings/PermissionsSection.tsx
index 9ab49da048..72141e3236 100644
--- a/src/components/bot-settings/PermissionsSection.tsx
+++ b/src/components/bot-settings/PermissionsSection.tsx
@@ -1,6 +1,6 @@
// LocalComputerAutoWarning remembers its bot, so a bot switch while it is up never applies the choice to the new bot.
import { useTeamPeople } from "@/state/team-people";
-import { useEffect, useState } from "react";
+import { useState } from "react";
import { Crown } from "lucide-react";
import { cn } from "@/lib/cn";
@@ -166,7 +166,7 @@ export function PermissionsSection({
{...commandAllowlistTarget}
onClose={() => setCommandAllowlistTarget(null)}
/>}
- {!draft && shows("outbound") && <OutboundControl key={bot.id} bot={bot} onChange={(outbound) => patch({ outbound })} />}
+ {!draft && shows("outbound") && <OutboundControl bot={bot} onChange={(outbound) => patch({ outbound })} />}
<LocalComputerAutoWarning
open={localAutoWarning !== null}
onCancel={() => setLocalAutoWarning(null)}
@@ -193,34 +193,6 @@ function PeersListNote({ peers, bots, onOpen }: { peers: readonly string[]; bots
function OutboundControl({ bot, onChange }: { bot: Bot; onChange: (policy: OutboundPolicy) => void }) {
const policy = bot.outbound ?? DEFAULT_OUTBOUND_POLICY;
- const [today, setToday] = useState<number | null>(null);
- const [capDraft, setCapDraft] = useState(String(policy.dailyCap));
-
- useEffect(() => {
- setCapDraft(String(policy.dailyCap));
- }, [policy.dailyCap]);
-
- useEffect(() => {
- let alive = true;
- void fetch(`/api/bots/${bot.id}/outbound`)
- .then((res) => (res.ok ? res.json() : null))
- .then((body: { today?: number } | null) => {
- if (alive && body && typeof body.today === "number") setToday(body.today);
- })
- .catch(() => {});
- return () => {
- alive = false;
- };
- }, [bot.id, bot.outbound]);
-
- const commitCap = () => {
- const parsed = Number(capDraft);
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > 1000) {
- setCapDraft(String(policy.dailyCap));
- return;
- }
- if (parsed !== policy.dailyCap) onChange({ policy: policy.policy, dailyCap: parsed });
- };
return (
<div className="rounded-xl bg-card p-4">
@@ -241,7 +213,7 @@ function OutboundControl({ bot, onChange }: { bot: Bot; onChange: (policy: Outbo
type="button"
aria-pressed={policy.policy === value}
onClick={() => {
- if (value !== policy.policy) onChange({ policy: value, dailyCap: policy.dailyCap });
+ if (value !== policy.policy) onChange({ policy: value });
}}
className={cn(
"flex-1 rounded-md px-2.5 py-1.5 text-[13px] font-medium",
@@ -252,30 +224,6 @@ function OutboundControl({ bot, onChange }: { bot: Bot; onChange: (policy: Outbo
</button>
))}
</div>
- {policy.policy === "allow" && (
- <div className="mt-3 flex flex-wrap items-center gap-3 text-[13px] text-ink-secondary">
- <label className="flex items-center gap-2">
- {t("permissions.outbound.upTo")}
- <input
- type="number"
- min={1}
- max={1000}
- value={capDraft}
- onChange={(event) => setCapDraft(event.target.value)}
- onBlur={commitCap}
- onKeyDown={(event) => {
- if (event.key === "Enter") (event.target as HTMLInputElement).blur();
- }}
- aria-label={t("permissions.outbound.dailyLimit")}
- className="w-20 rounded-md bg-inset px-2 py-1 text-[13px] text-ink tabular-nums outline-none focus:ring-1 focus:ring-accent"
- />
- {t("permissions.outbound.perDay")}
- </label>
- <span className="tabular-nums">
- {today === null ? "" : t("permissions.outbound.usedToday", { today, cap: policy.dailyCap })}
- </span>
- </div>
- )}
</div>
);
}
diff --git a/src/locales/en.json b/src/locales/en.json
index 1185c582fa..0e75713124 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -3228,15 +3228,11 @@
"permissions.approval.helpHanded": "Default for new threads, routines and work handed to it. Full access also applies at once to every existing thread. Use Refresh permissions on a thread to apply the current level to that conversation.",
"permissions.approval.applyFull": "Apply Full access to all threads",
"permissions.outbound.title": "Sending on your behalf",
- "permissions.outbound.help": "Emails, messages, posts, invites, and payments through connected apps. Reading and drafting never count. Full access sends without asking unless you set a rule here.",
+ "permissions.outbound.help": "Emails, messages, posts, invites, and payments through connected apps. Reading and drafting don't count as sending. Full access sends without asking unless you set a rule here.",
"permissions.outbound.ask": "Ask every time",
"permissions.outbound.askHint": "Every send waits for your tap.",
- "permissions.outbound.allow": "Allow a daily amount",
- "permissions.outbound.allowHint": "Sends go out on their own, up to the cap below.",
- "permissions.outbound.upTo": "Up to",
- "permissions.outbound.dailyLimit": "Daily outbound limit",
- "permissions.outbound.perDay": "a day",
- "permissions.outbound.usedToday": "{today} of {cap} used today",
+ "permissions.outbound.allow": "Send without asking",
+ "permissions.outbound.allowHint": "Sends go out without waiting for your tap.",
"permissions.localAuto.title": "Allow Auto mode on this computer?",
"permissions.localAuto.body": "Auto mode will let this bot click, type, and run tools on this computer without asking first. Destructive and sensitive actions still stop. Continue only if you are watching.",
"rename.aria": "Rename",
diff --git a/src/locales/it.json b/src/locales/it.json
index 583a78ed51..f74b24d688 100644
--- a/src/locales/it.json
+++ b/src/locales/it.json
@@ -2680,12 +2680,8 @@
"permissions.outbound.title": "Invii per tuo conto",
"permissions.outbound.ask": "Chiedi ogni volta",
"permissions.outbound.askHint": "Ogni invio aspetta un tuo clic.",
- "permissions.outbound.allow": "Consenti una quota giornaliera",
- "permissions.outbound.allowHint": "Gli invii partono da soli, fino al tetto qui sotto.",
- "permissions.outbound.upTo": "Fino a",
- "permissions.outbound.dailyLimit": "Limite giornaliero di invii",
- "permissions.outbound.perDay": "al giorno",
- "permissions.outbound.usedToday": "{today} di {cap} usati oggi",
+ "permissions.outbound.allow": "Invia senza chiedere",
+ "permissions.outbound.allowHint": "Gli invii partono senza aspettare un tuo clic.",
"permissions.localAuto.title": "Consentire la modalità Auto su questo computer?",
"permissions.localAuto.body": "La modalità Auto lascia che questo bot clicchi, scriva ed esegua strumenti su questo computer senza chiedere prima. Le azioni distruttive e sensibili si fermano comunque. Continua solo se stai guardando.",
"rename.aria": "Rinomina",
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 889300aeaf..c24ffcbe43 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -3063,12 +3063,8 @@
"permissions.outbound.title": "代理での送信",
"permissions.outbound.ask": "毎回確認する",
"permissions.outbound.askHint": "送信のたびに、あなたの操作を待ちます。",
- "permissions.outbound.allow": "1日の上限まで許可",
- "permissions.outbound.allowHint": "下の上限まで、自動で送信されます。",
- "permissions.outbound.upTo": "上限",
- "permissions.outbound.dailyLimit": "1日の送信上限",
- "permissions.outbound.perDay": "件/日",
- "permissions.outbound.usedToday": "本日 {cap}件中{today}件を使用",
+ "permissions.outbound.allow": "確認せずに送信",
+ "permissions.outbound.allowHint": "あなたの操作を待たずに送信されます。",
"permissions.localAuto.title": "このコンピューターでの自動モードを許可しますか?",
"permissions.localAuto.body": "自動モードでは、このボットが事前の確認なしに、このコンピューター上でクリック、入力、ツールの実行を行います。破壊的な操作や機密性の高い操作では、引き続き停止します。画面を見ている場合にのみ続行してください。",
"rename.aria": "名前を変更",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index ebbe2e0ada..110e1ad2cf 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -2946,12 +2946,8 @@
"permissions.outbound.title": "대신 보내기",
"permissions.outbound.ask": "매번 묻기",
"permissions.outbound.askHint": "보낼 때마다 내가 누르기를 기다려요.",
- "permissions.outbound.allow": "하루 허용량 정하기",
- "permissions.outbound.allowHint": "아래 한도까지는 알아서 보내요.",
- "permissions.outbound.upTo": "최대",
- "permissions.outbound.dailyLimit": "하루 발신 한도",
- "permissions.outbound.perDay": "하루",
- "permissions.outbound.usedToday": "오늘 {cap} 중 {today} 사용",
+ "permissions.outbound.allow": "묻지 않고 보내기",
+ "permissions.outbound.allowHint": "내가 누르기를 기다리지 않고 보내요.",
"permissions.localAuto.title": "이 컴퓨터에서 자동 모드를 허용할까요?",
"permissions.localAuto.body": "자동 모드에서는 이 봇이 묻지 않고 이 컴퓨터에서 클릭하고, 입력하고, 도구를 실행해요. 파괴적이거나 민감한 작업에서는 여전히 멈춰요. 지켜보고 있을 때만 계속하세요.",
"rename.aria": "이름 바꾸기",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index 9a2a94657e..f41793fa7e 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -2737,12 +2737,8 @@
"permissions.outbound.title": "Wysyłanie w twoim imieniu",
"permissions.outbound.ask": "Pytaj za każdym razem",
"permissions.outbound.askHint": "Każde wysłanie czeka na twoje kliknięcie.",
- "permissions.outbound.allow": "Zezwól na dzienny limit",
- "permissions.outbound.allowHint": "Wiadomości wychodzą samodzielnie, do limitu poniżej.",
- "permissions.outbound.upTo": "Do",
- "permissions.outbound.dailyLimit": "Dzienny limit wysyłania",
- "permissions.outbound.perDay": "dziennie",
- "permissions.outbound.usedToday": "Wykorzystano dziś: {today} z {cap}",
+ "permissions.outbound.allow": "Wysyłaj bez pytania",
+ "permissions.outbound.allowHint": "Wiadomości wychodzą bez czekania na twoje kliknięcie.",
"permissions.localAuto.title": "Zezwolić na tryb Auto na tym komputerze?",
"permissions.localAuto.body": "Tryb Auto pozwoli temu botowi klikać, pisać i uruchamiać narzędzia na tym komputerze bez wcześniejszego pytania. Działania destrukcyjne i wrażliwe nadal zostaną zatrzymane. Kontynuuj tylko, jeśli masz to na oku.",
"rename.aria": "Zmień nazwę",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index b6bf9530a6..94cf233e41 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -3091,15 +3091,11 @@
"permissions.approval.helpHanded": "Padrão para novas conversas, rotinas e trabalhos delegados ao bot. O acesso total também se aplica imediatamente a todas as conversas existentes. Use “Atualizar permissões” em uma conversa para aplicar o nível atual a ela.",
"permissions.approval.applyFull": "Aplicar acesso total a todas as conversas",
"permissions.outbound.title": "Enviar em seu nome",
- "permissions.outbound.help": "E-mails, mensagens, publicações, convites e pagamentos por apps conectados. Ler e redigir nunca contam. Com acesso total, os envios não pedem confirmação, a menos que você defina uma regra aqui.",
+ "permissions.outbound.help": "E-mails, mensagens, publicações, convites e pagamentos por apps conectados. Ler e redigir não contam como envio. Com acesso total, os envios não pedem confirmação, a menos que você defina uma regra aqui.",
"permissions.outbound.ask": "Perguntar sempre",
"permissions.outbound.askHint": "Cada envio espera sua confirmação.",
- "permissions.outbound.allow": "Permitir envios com limite diário",
- "permissions.outbound.allowHint": "Os envios são feitos automaticamente até o limite abaixo.",
- "permissions.outbound.upTo": "Até",
- "permissions.outbound.dailyLimit": "Limite diário de envios",
- "permissions.outbound.perDay": "por dia",
- "permissions.outbound.usedToday": "Uso hoje: {today} de {cap}",
+ "permissions.outbound.allow": "Enviar sem perguntar",
+ "permissions.outbound.allowHint": "Os envios saem sem esperar sua confirmação.",
"permissions.localAuto.title": "Permitir o modo Auto neste computador?",
"permissions.localAuto.body": "O modo Auto vai deixar este bot clicar, digitar e executar ferramentas neste computador sem perguntar antes. Ele ainda para antes de ações destrutivas e sensíveis. Continue só se você estiver acompanhando.",
"rename.aria": "Renomear",
diff --git a/src/locales/ru.json b/src/locales/ru.json
index cd22216859..3f58ce7fe5 100644
--- a/src/locales/ru.json
+++ b/src/locales/ru.json
@@ -2775,12 +2775,8 @@
"permissions.outbound.title": "Отправка от вашего имени",
"permissions.outbound.ask": "Спрашивать каждый раз",
"permissions.outbound.askHint": "Каждая отправка ждёт вашего подтверждения.",
- "permissions.outbound.allow": "Разрешить дневной лимит",
- "permissions.outbound.allowHint": "Отправки выполняются самостоятельно, в пределах лимита ниже.",
- "permissions.outbound.upTo": "До",
- "permissions.outbound.dailyLimit": "Дневной лимит отправки",
- "permissions.outbound.perDay": "в день",
- "permissions.outbound.usedToday": "Использовано сегодня: {today} из {cap}",
+ "permissions.outbound.allow": "Отправлять без вопросов",
+ "permissions.outbound.allowHint": "Отправки уходят сразу, без вашего подтверждения.",
"permissions.localAuto.title": "Разрешить режим Auto на этом компьютере?",
"permissions.localAuto.body": "В режиме Auto этот бот сможет нажимать, вводить текст и запускать инструменты на этом компьютере без предварительного запроса. Разрушительные и чувствительные действия по-прежнему блокируются. Продолжайте, только если вы наблюдаете за работой.",
"rename.aria": "Переименовать",
diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.json
index 8715f44d93..c545aeb802 100644
--- a/src/locales/source-hashes.json
+++ b/src/locales/source-hashes.json
@@ -17373,12 +17373,8 @@
"permissions.outbound.title": "38c45167f70694d06c7e73599fa2a1310a9e5c78786a85028e0571861dce6ae1",
"permissions.outbound.ask": "91da6bc629e0a3283107d5d84072d03044ec6818d41c65cb2726e3a89f67da17",
"permissions.outbound.askHint": "3d5ff01e5232f977ef1e70162cde31de4235d27229413971b4b277d5a0b7ae93",
- "permissions.outbound.allow": "ab8b05e8b68815e905fc6e049e31409e6e717d71d4129d3e3238d3e651196987",
- "permissions.outbound.allowHint": "2ae5244868717edec97371b71782aa5bc6b7109df0f55eb146605e7a31d3b693",
- "permissions.outbound.upTo": "3e2884632c01454fba221caccb1959015f5a5487f1375adf9cdc8a56bdd12bce",
- "permissions.outbound.dailyLimit": "9408c89b8d5361983c65f5a8321ac2290ad4d5039e4f8387b67eaecd6e0a71cc",
- "permissions.outbound.perDay": "4ed042e01ceba40277e5f5b7a6beb0d47865056fc751c0ba33d00204f9e5807c",
- "permissions.outbound.usedToday": "60cfab4fb23b4b8811c16c12ba011f8d310cb411fc8b0239c12c286959ada6db",
+ "permissions.outbound.allow": "1a17d0a9963ce12493e29e52f8e51d54c6c5021e16fabefcf3a280a3433cc723",
+ "permissions.outbound.allowHint": "2e3bd32ebdcc714f48bb3c00b6b341e11a6f8d0f68de32fe7b9498092aa64e3d",
"permissions.localAuto.title": "160cbc3b3d71471fbd4b7b38fb72542980c549f59df69d1f4b87b48ad580bffb",
"permissions.localAuto.body": "0b9208f238d44a98450bffee9bfcba94ccd446a494b2f341afdf38dc2eee50c7",
"rename.aria": "3064d79a295cefe4b384b8fe5cb29fd6b06d7eb1ad94b8895f4148039d06b330",
@@ -25765,15 +25761,11 @@
"permissions.approval.helpHanded": "b8438b3ccfc9b0ccd48d1d324cdedcac9741c33ba33120e85604111342d3988d",
"permissions.approval.applyFull": "b2db906c8a2176ef34513004fa2d97f8443a148149a488bc8d6a243291aaa646",
"permissions.outbound.title": "38c45167f70694d06c7e73599fa2a1310a9e5c78786a85028e0571861dce6ae1",
- "permissions.outbound.help": "4662c329b57100d99e4e3e27a10178b944e6f4b3bdfc0e8b2f048776a9719fe0",
+ "permissions.outbound.help": "f50c72c7db31cb4c0b7f71e2b5d96fc570aaa96c5fc3d26330ec94db681d21b3",
"permissions.outbound.ask": "91da6bc629e0a3283107d5d84072d03044ec6818d41c65cb2726e3a89f67da17",
"permissions.outbound.askHint": "3d5ff01e5232f977ef1e70162cde31de4235d27229413971b4b277d5a0b7ae93",
- "permissions.outbound.allow": "ab8b05e8b68815e905fc6e049e31409e6e717d71d4129d3e3238d3e651196987",
- "permissions.outbound.allowHint": "2ae5244868717edec97371b71782aa5bc6b7109df0f55eb146605e7a31d3b693",
- "permissions.outbound.upTo": "3e2884632c01454fba221caccb1959015f5a5487f1375adf9cdc8a56bdd12bce",
- "permissions.outbound.dailyLimit": "9408c89b8d5361983c65f5a8321ac2290ad4d5039e4f8387b67eaecd6e0a71cc",
- "permissions.outbound.perDay": "4ed042e01ceba40277e5f5b7a6beb0d47865056fc751c0ba33d00204f9e5807c",
- "permissions.outbound.usedToday": "60cfab4fb23b4b8811c16c12ba011f8d310cb411fc8b0239c12c286959ada6db",
+ "permissions.outbound.allow": "1a17d0a9963ce12493e29e52f8e51d54c6c5021e16fabefcf3a280a3433cc723",
+ "permissions.outbound.allowHint": "2e3bd32ebdcc714f48bb3c00b6b341e11a6f8d0f68de32fe7b9498092aa64e3d",
"permissions.localAuto.title": "160cbc3b3d71471fbd4b7b38fb72542980c549f59df69d1f4b87b48ad580bffb",
"permissions.localAuto.body": "0b9208f238d44a98450bffee9bfcba94ccd446a494b2f341afdf38dc2eee50c7",
"rename.aria": "3064d79a295cefe4b384b8fe5cb29fd6b06d7eb1ad94b8895f4148039d06b330",
@@ -37187,12 +37179,8 @@
"permissions.outbound.title": "38c45167f70694d06c7e73599fa2a1310a9e5c78786a85028e0571861dce6ae1",
"permissions.outbound.ask": "91da6bc629e0a3283107d5d84072d03044ec6818d41c65cb2726e3a89f67da17",
"permissions.outbound.askHint": "3d5ff01e5232f977ef1e70162cde31de4235d27229413971b4b277d5a0b7ae93",
- "permissions.outbound.allow": "ab8b05e8b68815e905fc6e049e31409e6e717d71d4129d3e3238d3e651196987",
- "permissions.outbound.allowHint": "2ae5244868717edec97371b71782aa5bc6b7109df0f55eb146605e7a31d3b693",
- "permissions.outbound.upTo": "3e2884632c01454fba221caccb1959015f5a5487f1375adf9cdc8a56bdd12bce",
- "permissions.outbound.dailyLimit": "9408c89b8d5361983c65f5a8321ac2290ad4d5039e4f8387b67eaecd6e0a71cc",
- "permissions.outbound.perDay": "4ed042e01ceba40277e5f5b7a6beb0d47865056fc751c0ba33d00204f9e5807c",
- "permissions.outbound.usedToday": "60cfab4fb23b4b8811c16c12ba011f8d310cb411fc8b0239c12c286959ada6db",
+ "permissions.outbound.allow": "1a17d0a9963ce12493e29e52f8e51d54c6c5021e16fabefcf3a280a3433cc723",
+ "permissions.outbound.allowHint": "2e3bd32ebdcc714f48bb3c00b6b341e11a6f8d0f68de32fe7b9498092aa64e3d",
"permissions.localAuto.title": "160cbc3b3d71471fbd4b7b38fb72542980c549f59df69d1f4b87b48ad580bffb",
"permissions.localAuto.body": "0b9208f238d44a98450bffee9bfcba94ccd446a494b2f341afdf38dc2eee50c7",
"onboarding.meet.title": "840d2919f710b033c4661fb5b2c83a707eb8e676f4c10d9f0408300f460126e7",
@@ -60853,12 +60841,8 @@
"permissions.outbound.title": "38c45167f70694d06c7e73599fa2a1310a9e5c78786a85028e0571861dce6ae1",
"permissions.outbound.ask": "91da6bc629e0a3283107d5d84072d03044ec6818d41c65cb2726e3a89f67da17",
"permissions.outbound.askHint": "3d5ff01e5232f977ef1e70162cde31de4235d27229413971b4b277d5a0b7ae93",
- "permissions.outbound.allow": "ab8b05e8b68815e905fc6e049e31409e6e717d71d4129d3e3238d3e651196987",
- "permissions.outbound.allowHint": "2ae5244868717edec97371b71782aa5bc6b7109df0f55eb146605e7a31d3b693",
- "permissions.outbound.upTo": "3e2884632c01454fba221caccb1959015f5a5487f1375adf9cdc8a56bdd12bce",
- "permissions.outbound.dailyLimit": "9408c89b8d5361983c65f5a8321ac2290ad4d5039e4f8387b67eaecd6e0a71cc",
- "permissions.outbound.perDay": "4ed042e01ceba40277e5f5b7a6beb0d47865056fc751c0ba33d00204f9e5807c",
- "permissions.outbound.usedToday": "60cfab4fb23b4b8811c16c12ba011f8d310cb411fc8b0239c12c286959ada6db",
+ "permissions.outbound.allow": "1a17d0a9963ce12493e29e52f8e51d54c6c5021e16fabefcf3a280a3433cc723",
+ "permissions.outbound.allowHint": "2e3bd32ebdcc714f48bb3c00b6b341e11a6f8d0f68de32fe7b9498092aa64e3d",
"permissions.localAuto.title": "160cbc3b3d71471fbd4b7b38fb72542980c549f59df69d1f4b87b48ad580bffb",
"permissions.localAuto.body": "0b9208f238d44a98450bffee9bfcba94ccd446a494b2f341afdf38dc2eee50c7",
"rename.aria": "3064d79a295cefe4b384b8fe5cb29fd6b06d7eb1ad94b8895f4148039d06b330",
@@ -67521,12 +67505,8 @@
"permissions.outbound.title": "38c45167f70694d06c7e73599fa2a1310a9e5c78786a85028e0571861dce6ae1",
"permissions.outbound.ask": "91da6bc629e0a3283107d5d84072d03044ec6818d41c65cb2726e3a89f67da17",
"permissions.outbound.askHint": "3d5ff01e5232f977ef1e70162cde31de4235d27229413971b4b277d5a0b7ae93",
- "permissions.outbound.allow": "ab8b05e8b68815e905fc6e049e31409e6e717d71d4129d3e3238d3e651196987",
- "permissions.outbound.allowHint": "2ae5244868717edec97371b71782aa5bc6b7109df0f55eb146605e7a31d3b693",
- "permissions.outbound.upTo": "3e2884632c01454fba221caccb1959015f5a5487f1375adf9cdc8a56bdd12bce",
- "permissions.outbound.dailyLimit": "9408c89b8d5361983c65f5a8321ac2290ad4d5039e4f8387b67eaecd6e0a71cc",
- "permissions.outbound.perDay": "4ed042e01ceba40277e5f5b7a6beb0d47865056fc751c0ba33d00204f9e5807c",
- "permissions.outbound.usedToday": "60cfab4fb23b4b8811c16c12ba011f8d310cb411fc8b0239c12c286959ada6db",
+ "permissions.outbound.allow": "1a17d0a9963ce12493e29e52f8e51d54c6c5021e16fabefcf3a280a3433cc723",
+ "permissions.outbound.allowHint": "2e3bd32ebdcc714f48bb3c00b6b341e11a6f8d0f68de32fe7b9498092aa64e3d",
"permissions.localAuto.title": "160cbc3b3d71471fbd4b7b38fb72542980c549f59df69d1f4b87b48ad580bffb",
"permissions.localAuto.body": "0b9208f238d44a98450bffee9bfcba94ccd446a494b2f341afdf38dc2eee50c7",
"rename.aria": "3064d79a295cefe4b384b8fe5cb29fd6b06d7eb1ad94b8895f4148039d06b330",
@@ -74168,12 +74148,8 @@
"permissions.outbound.title": "38c45167f70694d06c7e73599fa2a1310a9e5c78786a85028e0571861dce6ae1",
"permissions.outbound.ask": "91da6bc629e0a3283107d5d84072d03044ec6818d41c65cb2726e3a89f67da17",
"permissions.outbound.askHint": "3d5ff01e5232f977ef1e70162cde31de4235d27229413971b4b277d5a0b7ae93",
- "permissions.outbound.allow": "ab8b05e8b68815e905fc6e049e31409e6e717d71d4129d3e3238d3e651196987",
- "permissions.outbound.allowHint": "2ae5244868717edec97371b71782aa5bc6b7109df0f55eb146605e7a31d3b693",
- "permissions.outbound.upTo": "3e2884632c01454fba221caccb1959015f5a5487f1375adf9cdc8a56bdd12bce",
- "permissions.outbound.dailyLimit": "9408c89b8d5361983c65f5a8321ac2290ad4d5039e4f8387b67eaecd6e0a71cc",
- "permissions.outbound.perDay": "4ed042e01ceba40277e5f5b7a6beb0d47865056fc751c0ba33d00204f9e5807c",
- "permissions.outbound.usedToday": "60cfab4fb23b4b8811c16c12ba011f8d310cb411fc8b0239c12c286959ada6db",
+ "permissions.outbound.allow": "1a17d0a9963ce12493e29e52f8e51d54c6c5021e16fabefcf3a280a3433cc723",
+ "permissions.outbound.allowHint": "2e3bd32ebdcc714f48bb3c00b6b341e11a6f8d0f68de32fe7b9498092aa64e3d",
"permissions.localAuto.title": "160cbc3b3d71471fbd4b7b38fb72542980c549f59df69d1f4b87b48ad580bffb",
"permissions.localAuto.body": "0b9208f238d44a98450bffee9bfcba94ccd446a494b2f341afdf38dc2eee50c7",
"rename.aria": "3064d79a295cefe4b384b8fe5cb29fd6b06d7eb1ad94b8895f4148039d06b330",
@@ -81115,12 +81091,8 @@
"permissions.outbound.title": "38c45167f70694d06c7e73599fa2a1310a9e5c78786a85028e0571861dce6ae1",
"permissions.outbound.ask": "91da6bc629e0a3283107d5d84072d03044ec6818d41c65cb2726e3a89f67da17",
"permissions.outbound.askHint": "3d5ff01e5232f977ef1e70162cde31de4235d27229413971b4b277d5a0b7ae93",
- "permissions.outbound.allow": "ab8b05e8b68815e905fc6e049e31409e6e717d71d4129d3e3238d3e651196987",
- "permissions.outbound.allowHint": "2ae5244868717edec97371b71782aa5bc6b7109df0f55eb146605e7a31d3b693",
- "permissions.outbound.upTo": "3e2884632c01454fba221caccb1959015f5a5487f1375adf9cdc8a56bdd12bce",
- "permissions.outbound.dailyLimit": "9408c89b8d5361983c65f5a8321ac2290ad4d5039e4f8387b67eaecd6e0a71cc",
- "permissions.outbound.perDay": "4ed042e01ceba40277e5f5b7a6beb0d47865056fc751c0ba33d00204f9e5807c",
- "permissions.outbound.usedToday": "60cfab4fb23b4b8811c16c12ba011f8d310cb411fc8b0239c12c286959ada6db",
+ "permissions.outbound.allow": "1a17d0a9963ce12493e29e52f8e51d54c6c5021e16fabefcf3a280a3433cc723",
+ "permissions.outbound.allowHint": "2e3bd32ebdcc714f48bb3c00b6b341e11a6f8d0f68de32fe7b9498092aa64e3d",
"permissions.localAuto.title": "160cbc3b3d71471fbd4b7b38fb72542980c549f59df69d1f4b87b48ad580bffb",
"permissions.localAuto.body": "0b9208f238d44a98450bffee9bfcba94ccd446a494b2f341afdf38dc2eee50c7",
"rename.aria": "3064d79a295cefe4b384b8fe5cb29fd6b06d7eb1ad94b8895f4148039d06b330",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 9c1249cb3e..7f8f124dfa 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -3079,12 +3079,8 @@
"permissions.outbound.title": "代你发送内容",
"permissions.outbound.ask": "每次都询问",
"permissions.outbound.askHint": "每次发送都需要你确认。",
- "permissions.outbound.allow": "允许每日额度",
- "permissions.outbound.allowHint": "发送会自行发出,不超过下方的上限。",
- "permissions.outbound.upTo": "最多",
- "permissions.outbound.dailyLimit": "每日发送上限",
- "permissions.outbound.perDay": "每天",
- "permissions.outbound.usedToday": "今天已用 {today}/{cap}",
+ "permissions.outbound.allow": "无需询问,直接发送",
+ "permissions.outbound.allowHint": "发送会直接发出,无需你确认。",
"permissions.localAuto.title": "允许在这台电脑上使用自动模式?",
"permissions.localAuto.body": "自动模式会让这个机器人在不先询问的情况下,在这台电脑上点击、输入并运行工具。破坏性操作和敏感操作仍会停下。仅在你全程关注时继续。",
"rename.aria": "重命名",
diff --git a/src/state/store.tsx b/src/state/store.tsx
index 2463ec6001..eec7748395 100644
--- a/src/state/store.tsx
+++ b/src/state/store.tsx
@@ -323,7 +323,7 @@ export interface Bot extends DefaultBotFields, Pick<WireBot, "mascotFaceColor" |
composio?: boolean;
connectorTools?: Record<string, ConnectorToolGrant>;
connectorScopes?: { apps: Record<string, "read" | "write"> }; phoneApps?: import("../../shared/phone-apps").PhoneApps;
- outbound?: { policy: "ask" | "allow"; dailyCap: number };
+ outbound?: { policy: "ask" | "allow" };
fallback?: Array<{ instanceId: string; model: string }>;
browser?: boolean;
recordBrowserSteps?: boolean;