Deploys working Python code as a DataGen standalone deployment. This tool orchestrates the complete workflow: takes your Python code, tests it, and creates a standalone deployment as an API endpoint with default values. Perfect for converting working code into a production-ready deployment withou...
Risk signalsAccepts freeform code/query input (script) · High parameter count (12 properties)
Part of the DataGen server.
Free to start. No card required.
AI agents invoke deployCode to trigger processes or run actions in DataGen. Execute operations can have side effects beyond the immediate call -- triggering builds, sending notifications, or starting workflows. Rate limits and argument validation are essential to prevent runaway execution.
deployCode can trigger processes with real-world consequences. An uncontrolled agent might start dozens of builds, send mass notifications, or kick off expensive compute jobs. PolicyLayer enforces rate limits and validates arguments to keep execution within safe bounds.
Execute tools trigger processes. Rate-limit and validate arguments to prevent unintended side effects.
{
"version": "1",
"default": "deny",
"tools": {
"deployCode": {
"limits": [
{
"counter": "deploycode_rate",
"window": "minute",
"max": 10,
"scope": "grant"
}
]
}
}
} See the full DataGen policy for all 20 tools.
These attack patterns abuse exactly the kind of access deployCode gives an agent. Each links to the full case and the policy that stops it:
Other execute tools across the catalogue. The same approach applies to each: rate-limit and validate the arguments.
Deploys working Python code as a DataGen standalone deployment. This tool orchestrates the complete workflow: takes your Python code, tests it, and creates a standalone deployment as an API endpoint with default values. Perfect for converting working code into a production-ready deployment without flows. Uses OpenAPI/JSON Schema for rich input and output validation with descriptions, type constraints, default values, and comprehensive documentation. Schema Example: input_schema: { 'type': 'object', 'properties': { 'name': {'type': 'string', 'description': 'User name'}, 'count': {'type': 'integer', 'minimum': 1, 'default': 10}, 'data': {'type': 'array', 'items': {'type': 'string'}} }, 'required': ['name'] } Do not use any local() or global() in the code. you can assume the input variables are already defined in the global scope. and you can use them directly with data type defined in the input_schema. Do Not Return anthing for Output Deploy code use the globa variable to reference the input and output variables. so do not return in main script. otherwise it would trigger ReturnException. To return output, just reference the global variable. for example: if I need to return the output variable "result" in the main script, I can do this: result = "Hello, World!" and in the output_variables, I can do this: output_variables: ['result'] just simply reference the global variable in the output_variables. No Async in the code Do not use any async in the code. it will cause the code to not work. Steps to take before deploying code <step0> Try to briefly explain the code or plan to the user. </step0> <step1> Come up with right input_schema and output_schema to define the input and output variables </step1> <step2> Confirm with user if the input and output are correct. modify if needed. </step2> <step3> Run submitDeploymentRun tool to test the code is working on Datagen after the deployment is created. </step3>. It is categorised as a Execute tool in the DataGen MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
Register the DataGen MCP server in PolicyLayer and add a rule for deployCode: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches DataGen. Nothing to install.
deployCode is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the deployCode rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for deployCode. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
deployCode is provided by the DataGen MCP server (kuoyusheng/datagendev). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Deterministic rules across all 20 DataGen tools. Per-identity grants. Full audit log. Live in minutes. Nothing to install.
Free to start. No card required.
4,600+ MCP servers and 31,000+ tools scanned and risk-classified.