ADK for TypeScript: API Reference
    Preparing search index...

    Class ContainerCodeExecutor

    A code executor that runs model-generated code inside a hardened Docker container via the dockerode client.

    Security note: this executor runs model-generated code, which may be influenced by untrusted input (e.g. via prompt injection). By default the container is started with networking disabled and all Linux capabilities dropped so the executed code cannot reach the network (including the cloud metadata endpoint at 169.254.169.254) or escalate privileges. Networking can be re-enabled via networkEnabled: true when the executed code is trusted.

    Limitations: this executor runs a code string only. inputFiles and args on the request are not copied into the container, and output files are not collected (outputFiles is always empty), so tools that stage resource files or read artifacts back (e.g. RunSkillScriptTool) are not yet supported. Sending files in and out via putArchive/getArchive is future work.

    Hierarchy (View Summary)

    Constructors

    Properties

    "[BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL]": true

    A unique symbol to identify BaseCodeExecutor class.

    codeBlockDelimiters: [string, string][] = ...

    The list of the enclosing delimiters to identify the code blocks. For example, the delimiter('javascript\\n', '\\n') can be used to identify code blocks with the following format:

     console.log("hello")
    
    errorRetryAttempts: number = 2

    The number of attempts to retry on consecutive code execution errors. Default to 2.

    executionResultDelimiters: [string, string] = ...

    The delimiters to format the code execution result.

    optimizeDataFile: boolean = false

    If true, extract and process data files from the model request and attach them to the code executor.

    Supported data file MimeTypes are [text/csv]. Default to false.

    stateful: boolean = false

    Whether the code executor is stateful. Default to false.

    Methods