Skip to main content

Overview

invoke_skill and poll_skill provide non-blocking skill task execution. invoke_skill sends a non-blocking request to the AgentKit skills sandbox via the A2A protocol, creates a skill task, and returns the initial task object immediately. poll_skill fetches the current status snapshot of a task by its task ID. Used together, they let you start a long-running skill workflow without blocking the agent’s reasoning and poll for status on demand. Compared to execute_skills: Use cases:
  • The skill workflow takes a long time and you do not want to block a single tool call waiting for completion;
  • You need to perform other work after starting a skill task and check the result later;
  • You need custom control over how and when to poll.
invoke_skill and poll_skill reuse the sandbox infrastructure and credential configuration of execute_skills. Environment variables, Tool IDs, inbound identity credentials, and other prerequisites are the same as those described on the Code sandbox page.

Usage

Import path:
Register both tools on the Agent tools list. The agent can then call invoke_skill to start a skill task and poll_skill to query its status during reasoning.
skill_tasks_agent.py

Task object

Both invoke_skill and poll_skill return an A2A task object (dict) containing the following key fields: Task states: working is a non-terminal state; all others are terminal. Once a task reaches a terminal state, subsequent poll_skill calls return the same snapshot.

invoke_skill

Creates an A2A skill task and returns the initial task object. Sends a non-blocking message/send request without waiting for the task to complete.
tool_context is marked optional in the signature but is required at call time; omitting it raises an error. VeADK injects it automatically during agent execution — you do not need to pass it manually.

poll_skill

Fetches the current status snapshot of an A2A skill task. Sends a tasks/get request and returns the task object.
tool_context is marked optional in the signature but is required at call time; omitting it raises an error. VeADK injects it automatically during agent execution — you do not need to pass it manually.

Security

invoke_skill and poll_skill execute workflows in a remote skills sandbox. Code in the sandbox can access services reachable from the sandbox network and read or write files. Before running, confirm that the skill source is trusted and restrict the data, network, and permissions available to the sandbox. The inbound identity credential (credential key inbound_auth) is forwarded to the skills sandbox in the inbound_auth request header so the sandbox workflow runs under the original user identity; when the current request carries no inbound credential, the header is omitted and the sandbox runs anonymously. See Inbound authentication for the source and configuration of inbound identity credentials.
Last modified on September 19, 2026