import { defineActions, createArcAgentRuntime } from "@geostack/arc";
// Declare the dangerous action once — with its risk.
export const actions = defineActions({
increase_ad_budget: {
name: "increase_ad_budget",
risk: "critical",
defaultDecision: "ask",
input: { amount_usd: 0 },
},
});
// The agent proposes the action. Arc decides BEFORE any side effect.
const runtime = createArcAgentRuntime({ agentToken });
const res = await runtime.invoke(appId, "increase_ad_budget", {
amount_usd: 500_000_000,
});
if (res.status === "blocked") {
// decision: "block" — nothing executed. The decision is audited;
// res.invocation_id links to the hash-chained log entry below.
throw new Error("org spend cap reached");
}