MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / createPolicyCode

Function createPolicyCode

e2e/scenarios/run-panel-auto-approve.test.ts:40–47  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

38/** Sandbox code that creates a policy through the approval-gated core tool. The
39 * pattern is unique-per-run and matches no real tool, so the rule is inert. */
40const createPolicyCode = (pattern: string) => `
41await tools.executor.coreTools.policies.create({
42 owner: "user",
43 pattern: ${JSON.stringify(pattern)},
44 action: "block",
45});
46return ${JSON.stringify(approvedPayload)};
47`;
48
49// Why this was long skipped: `autoApprove: true` came back `"paused"` instead of
50// `"completed"`, and static reading of the wiring (HTTP schema, handler, the

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected