# Agent Script

An open, schema-driven specification language for configuring an AI agent's state, execution flow, string templates and deterministic hooks, developed for Salesforce's Agentforce but intended to describe agents generally.

Agent Script lets a developer describe an agent as a single file in a custom syntax that stores state, defines instructions and available actions, and specifies execution flow, without prescribing how deterministic or autonomous the resulting agent should be. Determinism and autonomy sit on a single spectrum: a before_reasoning hook can gate transitions and an if or else block can focus the model's instructions for a mostly deterministic agent, or a single reasoning instructions block can let the model reason freely, with most real agents falling somewhere between.

Because execution is decoupled from specification, describing what the agent is rather than how a runtime executes it, the same script can run on a more capable runtime later without being rewritten. The repository holds parsing and linting support for the base, Agentforce and Agentfabric dialects, an Agentforce dialect compiler, and editor and language-server tooling, along with a formal language specification; the simplest setup uses mise to install the pinned Node.js and tree-sitter CLI versions.

Website: https://github.com/salesforce/agentscript
