Home/Tools/@tpmjs/tools-sprites-policy-get

spritesPolicyGetTool

@tpmjs/tools-sprites-policy-get

Retrieve the current network policy for a sprite including allowed domains and filtering rules. Use this to understand what network access a sprite has.

Official
sandbox
v0.1.3
MIT

Interactive Playground

Test @tpmjs/tools-sprites-policy-get (spritesPolicyGetTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-sprites-policy-get
pnpm add @tpmjs/tools-sprites-policy-get
yarn add @tpmjs/tools-sprites-policy-get
bun add @tpmjs/tools-sprites-policy-get
deno add npm:@tpmjs/tools-sprites-policy-get

2. Import the tool

import { spritesPolicyGetTool } from '@tpmjs/tools-sprites-policy-get';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { spritesPolicyGetTool } from '@tpmjs/tools-sprites-policy-get';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { spritesPolicyGetTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Parameters

Available configuration options

Auto-extracted
name
Required
Type: string

Name of the sprite to get policy for

Schema extracted: 1/16/2026, 3:45:30 AM

README

@tpmjs/sprites-policy-get

Retrieve the current network policy for a sprite including allowed domains.

Installation

npm install @tpmjs/sprites-policy-get

Requirements

Usage

import { spritesPolicyGetTool } from '@tpmjs/sprites-policy-get';

const result = await spritesPolicyGetTool.execute({
  name: 'my-sandbox'
});

console.log(result);
// {
//   mode: 'allow',
//   domains: ['api.github.com', 'registry.npmjs.org'],
//   rules: []
// }

Input Parameters

ParameterTypeRequiredDescription
namestringYesName of the sprite to get policy for

Output

FieldTypeDescription
mode'allow' | 'deny'Policy mode
domainsstring[]List of domains affected by the policy
rulesobject[]?Optional additional filtering rules

Policy Modes

  • allow mode: Blocks all outbound traffic EXCEPT to listed domains
  • deny mode: Allows all outbound traffic EXCEPT to listed domains

Use Cases

  • Audit current network access for a sprite
  • Verify security policies are correctly applied
  • Debug connectivity issues
  • Review allowed domains before running sensitive code

Error Handling

The tool throws errors in these cases:

  • SPRITES_TOKEN environment variable is not set
  • Sprite not found (HTTP 404)
  • Invalid or expired API token (HTTP 401)
  • Network timeout (30 second limit)
  • API errors with descriptive messages

License

MIT

Statistics

Downloads/month

325

GitHub Stars

0

Quality Score

84%

Bundle Size

NPM Keywords

tpmjs
sprites
sandbox
network
policy
ai

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai
spritesPolicyGetTool | TPMJS | TPMJS