pub struct Agent {Show 14 fields
pub description: Option<String>,
pub purpose: Option<String>,
pub runner: Option<String>,
pub model: Option<String>,
pub prompt: Option<String>,
pub prompt_file: Option<PathBuf>,
pub access: Access,
pub entry: bool,
pub resident: bool,
pub fuel_usd: Option<f64>,
pub env_from: Vec<String>,
pub mcp: BTreeMap<String, McpServer>,
pub recovery: RecoveryPolicy,
pub work_dir: Option<PathBuf>,
}Expand description
A configured agent.
Fields§
§description: Option<String>One line saying what this agent is.
Handed to peers by layover_peers(), so a sending agent can tell who is worth talking to
without the topology being hard-coded into its prompt.
purpose: Option<String>A longer statement of what the agent is for and when to route work to it.
runner: Option<String>Runner to invoke; falls back to crate::config::Defaults::runner.
model: Option<String>Model identifier passed to the runner.
prompt: Option<String>The agent’s standing instructions, written inline.
Mutually exclusive with Agent::prompt_file; use Agent::prompt_spec rather than
reading either field directly.
prompt_file: Option<PathBuf>The agent’s standing instructions, read from a file that may compose others.
access: AccessWhether the agent may write to the shared workspace.
entry: boolWhether a human may send flights directly to this agent.
A named crate::pipeline::Pipeline also makes its entry agent reachable. This flag is
the lower-level permission, useful for an agent you want to be able to poke by hand
without declaring a trigger for it.
resident: boolWhether the agent is pinned resident rather than transient.
fuel_usd: Option<f64>Per-agent Fuel override, applied when an itinerary starts at this agent.
env_from: Vec<String>Names of environment variables forwarded to this agent’s own CLI.
The agent CLI needs credentials of its own before it can do anything: copilot wants a
GITHUB_TOKEN, claude an ANTHROPIC_API_KEY. Those are separate from the ones its MCP
servers need, which are declared per server in crate::mcp::McpServer::env_from, and
they are separate on purpose — the agent that publishes releases holds the publishing
token, and the one that reads telemetry does not.
Only names appear here. The Tower reads each value from its own environment at spawn time,
so layover.toml stays a file you can commit. A name that is not set refuses the run
rather than starting a CLI that will fail to authenticate several seconds later.
crate::config::Defaults::env_from covers the common case of every agent using the same
CLI credential; the two are combined rather than overriding one another.
mcp: BTreeMap<String, McpServer>MCP servers this agent may reach, keyed by name.
Layover’s own server is always wired up; these are the ones the agent needs to do its job
— a telemetry agent’s Kusto endpoint, a publisher’s issue tracker. Secrets never appear
here: see crate::mcp.
recovery: RecoveryPolicyWhether interrupted work for this agent may be restarted without asking.
The question is not whether the Tower can restart it but whether doing the work twice is safe. An agent that opened a pull request would open a second.
work_dir: Option<PathBuf>Directory this agent works in, overriding [layover] work_dir.
For an agent whose job is somewhere else entirely — mining telemetry from a different checkout, say. Resolved relative to the configuration file.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn prompt_spec(&self) -> Result<PromptSpec, PromptSpecError>
pub fn prompt_spec(&self) -> Result<PromptSpec, PromptSpecError>
Returns where this agent’s prompt comes from.
§Errors
Returns PromptSpecError when neither form is given or when both are.
Sourcepub fn description_or_placeholder(&self) -> &str
pub fn description_or_placeholder(&self) -> &str
Returns the one-line description, or a placeholder when none was configured.