⚠️ Experimental — Looks up an existing StackGen AI agent by name. When provider workspace_id is set, the lookup is scoped to that workspace.
# When to use: Adopt an app-managed or pre-existing agent read-only (e.g. SRE
# investigator) so workflows and attachments can reference it by name without
# owning the agent resource in this stack.
#
# Set provider workspace_id so the lookup is org-scoped.
data "sg_agent" "investigator" {
name = "sre-investigator"
}
output "investigator_integrations" {
value = data.sg_agent.investigator.integrations
}
name (String) Name of the agent to look up.auto_approve_tools (Attributes List) Rules for tools that bypass HITL approval. (see below for nested schema)auto_deny_tools (Set of String) Tool names that are always denied.contact_id (String) Identity for escalations.description (String) Human-readable description of the agent.environment (String) Deployment environment.id (String) Server-assigned identifier.integrations (Set of String) Names of guild-level integrations.is_router (Boolean) True when the agent is a logical MAB router for variants.model_names (Set of String) Names of registered models.parent_agent_id (String) Parent logical agent UUID when this agent is a variant.persona (String) System prompt / persona.remote_runners (Set of String) Remote runner names or IDs attached to this agent.semantic_router_policy_id (String) OPA policy ID for semantic routing.skills (Set of String) Skill locations for dynamic tools.status (String) Agent lifecycle status.tags (Set of String) Labels.tools (Set of String) Tool names this agent can invoke.auto_approve_toolsRequired:
tool (String) Tool name (exact, case-insensitive) or prefix wildcard ending in * (e.g. stackgen-mcp_*).Optional:
when_args_contain (String) JSON object that call arguments must contain (subset match). Omit or use {} for any arguments. Use jsonencode() in HCL for nested keys.