Skill Runtime API
Explore the isolated runtime lifecycle hooks, context injection payloads, and execution handlers required to implement secure agent skills.
Lifecycle Hook Handlers
Every skill package must export a standard execution entry interface. This ensures the SPM runtime host can securely trigger capabilities, inject environment tokens (like database credentials or API keys), validate inputs, and catch exceptions smoothly.
The core entry function performing the actual capability logic. It receives:
params: The strict object parameters validated against your manifest'sinputschema.context: System configurations, including credentials and active database connections.
Perform supplementary dynamic validations that JSON schemas cannot enforce (e.g. pinging an API host to verify key validity, or querying active files).
TypeScript Implementation Example
Here is a fully documented, production-grade template implementing standard execution lifecycle hooks:
Environment & Security Isolation
When executing in agent pipelines, skills operate under strict isolated execution sandboxes:
- No Arbitrary Environment Access: Skills can ONLY read environment keys explicitly registered in their workspace configurations. They cannot scan host machine environment states.
- CPU & Memory Sandboxing: Runtimes enforce memory limits (e.g. 512MB max for Node skills) and timeouts to prevent hanging infinite loops or recursive prompts.
- Network Whitelisting: Optional configurations in
spm.yamlrestrict skills to communicate only with registered remote API domains.