Updated · Markdown
Define AI agents as code, with Terraform or an API
Updated 2026-11-29. Written by the team that builds Tex, so weigh it accordingly.
Short answer: treat an agent like any other piece of infrastructure: its instructions, model, tools, triggers, sandbox rules and budget in files, reviewed in pull requests and applied by a tool. Tex stores every agent as versions, and you can manage them from the console, its admin API, or the Terraform provider meet-glen-ai/glen.
What an agent definition holds
In Tex an agent is one markdown document. Its header names the model, tools, triggers (schedules, feeds, webhooks), sandbox egress, budget and knowledge base. Its body holds the instructions, in the same shape as Claude Code subagents and skill files. Every save is a new version. A running session finishes on its version, and the next one runs the latest.
Ways to manage agents in Tex
- The console's builder, with a chat that drafts the agent beside the document, a form and a YAML view of the same draft.
- The admin API,
/v1/agents,/v1/knowledge-bases,/v1/feedsand the tools, with an admin's personal API token. - Terraform. The provider is meet-glen-ai/glen on the Terraform registry, open source at meet-glen-ai/terraform-provider-glen. It manages agents, knowledge bases, tools and members. We run our own agents this way.
terraform {
required_providers {
glen = { source = "meet-glen-ai/glen" }
}
}
Set GLEN_URL and GLEN_API_KEY (an admin's token from Settings) and run terraform plan.
Questions people ask
Who can change an agent? Admins. Members can run agents, chat with them and read, but not change them. A personal API token acts with its member's current role.
Can I start a run from my own code?
Yes. POST /v1/send/<agent> with a message starts a session and returns its id. Later messages go to /v1/sessions/<id>/messages.
Is every change recorded? Every agent version is kept, and the journal records what each member does.
What Tex doesn't do
- The Terraform provider is at an early version (0.1.0), so pin it.