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

Function createPolicyCode

e2e/scenarios/policy-tool-approval.test.ts:31–38  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

29/** Sandbox code that creates a policy through the gated core tool. The pattern
30 * is unique-per-run and matches no real tool, so the rule is inert. */
31const createPolicyCode = (pattern: string) => `
32const result = await tools.executor.coreTools.policies.create({
33 owner: "user",
34 pattern: ${JSON.stringify(pattern)},
35 action: "block",
36});
37return JSON.stringify(result);
38`;
39
40scenario(
41 "Policy tools · policies.create pauses for approval from its own annotation, then runs once approved",

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected