@tpmjs/tools-sprites-policy-set
Update the network policy for a sprite to control outbound network access with DNS-based filtering. Use 'allow' mode to block all traffic except listed domains, or 'deny' mode to allow all traffic except listed domains.
Mode must be 'allow' or 'deny'
Last checked: 1/16/2026, 3:45:35 AM
Test @tpmjs/tools-sprites-policy-set (spritesPolicySetTool) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-sprites-policy-setpnpm add @tpmjs/tools-sprites-policy-setyarn add @tpmjs/tools-sprites-policy-setbun add @tpmjs/tools-sprites-policy-setdeno add npm:@tpmjs/tools-sprites-policy-setimport { spritesPolicySetTool } from '@tpmjs/tools-sprites-policy-set';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { spritesPolicySetTool } from '@tpmjs/tools-sprites-policy-set';
const result = await generateText({
model: openai('gpt-4o'),
tools: { spritesPolicySetTool },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
namestringName of the sprite to update policy for
modestringPolicy mode - 'allow' blocks all except listed domains, 'deny' allows all except listed domains
domainsarrayList of domains to allow or deny based on mode
Schema extracted: 1/16/2026, 3:45:34 AM
Update the network policy for a sprite to control outbound network access.
npm install @tpmjs/sprites-policy-set
SPRITES_TOKEN environment variable - Get your token from https://sprites.devimport { spritesPolicySetTool } from '@tpmjs/sprites-policy-set'; // Allow only specific domains (block everything else) const result = await spritesPolicySetTool.execute({ name: 'my-sandbox', mode: 'allow', domains: ['api.github.com', 'registry.npmjs.org', 'pypi.org'] }); console.log(result); // { // policy: { // mode: 'allow', // domains: ['api.github.com', 'registry.npmjs.org', 'pypi.org'] // }, // applied: true // } // Block specific domains (allow everything else) const blockResult = await spritesPolicySetTool.execute({ name: 'my-sandbox', mode: 'deny', domains: ['malicious-site.com', 'tracking.example.com'] });
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the sprite to update policy for |
mode | 'allow' | 'deny' | Yes | Policy mode |
domains | string[] | Yes | List of domains to allow or deny based on mode |
| Field | Type | Description |
|---|---|---|
policy | NetworkPolicy | The applied network policy |
applied | boolean | Whether the policy was successfully applied |
| Field | Type | Description |
|---|---|---|
mode | 'allow' | 'deny' | Policy mode |
domains | string[] | List of domains affected by the policy |
rules | object[]? | Optional additional filtering rules |
allow mode: Blocks all outbound traffic EXCEPT to listed domains
deny mode: Allows all outbound traffic EXCEPT to listed domains
The tool throws errors in these cases:
SPRITES_TOKEN environment variable is not setMIT
Downloads/month
322
GitHub Stars
0
Quality Score