Skip to main content

Autessa CDK

Preview

The deploy API and the Autessa CDK are in preview and not yet released. Names and shapes may change before they are generally available. Projects with React apps can't deploy yet: app files are refused at Autessa's network edge until that is opened for the deploy API.

The Autessa CDK keeps your Autessa setup in a Git repo. Describe tables, tools, agents, apps, phone numbers and permissions in code. Preview every change, then deploy it to one tenant or many.

When to use it​

  • You want changes reviewed in pull requests, not clicked in a UI.
  • You run separate dev and prod tenants and want them to match.
  • You ship the same setup to many customer tenants.
  • You want to see when a change gives someone more access, before it ships.

How it works​

  1. Write resources in code, or pull them from an existing tenant.
  2. Build turns your code into a manifest plus files (tool sources, app bundles).
  3. Diff asks the server what would change in a stage. Changes that widen access are marked WIDENS.
  4. Deploy applies the change. It is idempotent and matched on each resource's logicalId.
  5. Rollback returns a stage to an earlier deployment.

Get started​

  • Try a complete app. autessa-cdk-sample is a help desk built with the CDK: tables with row security, a few tools, a Triage agent, a staff desk and a customer portal. Clone it, run it on your machine with npx autessa-cdk dev (no account needed), run its tests, then deploy it to your own tenant.
  • Start with an agent. Build an agent in code walks through init agent, test, chat and deploy.

The same commands run from each language's command line, the Maven and Gradle plugins, the GitHub Action and Autessa Pipelines.

Packages​

LanguagePackageRun commands with
Pythonautessa-cdk (autessa.cdk)autessa-cdk <command>
TypeScript@autessa/cdknpx autessa-cdk <command>
Javacom.autessa:autessa-cdk (com.autessa.cdk)The Maven plugin com.autessa:autessa-cdk-maven-plugin (mvn autessa-cdk:<command>) or the Gradle plugin com.autessa.cdk (gradle autessa<Command>, for example autessaDiff)

Every language has the same commands: init, test, chat, dev, build, diff, deploy, rollback and pull. The TypeScript CDK also has adopt-app. See Commands.

The CDK is separate from the feature packages you call from your app (firewall, SecurePass, RAG and the rest). Those come one at a time, or all together as autessa-sdk (@autessa/sdk on npm). See Features.

Install​

During the preview, install from GitHub (core and agents first):

pip install "autessa-core @ git+https://github.com/Autessa-Inc/autessa-python#subdirectory=packages/autessa-core"
pip install "autessa-agents @ git+https://github.com/Autessa-Inc/autessa-python#subdirectory=packages/autessa-agents"
pip install "autessa-cdk @ git+https://github.com/Autessa-Inc/autessa-python#subdirectory=packages/autessa-cdk"

A small project​

One table, one tool, one agent that uses the tool. The model is a stage variable, so dev and prod can use different values.

# autessa.config.py
from autessa.cdk import Agent, Column, Project, Table, Tool

project = Project("support-desk")
model = project.variable("model", default="small")

tickets = Table(project, "tickets",
columns=[
Column("subject", "SHORT_TEXT"),
Column("body", "LONG_TEXT"),
Column("status", "SINGLE_SELECT", options=["open", "closed"]),
],
vectorize=["body"])

lookup = Tool(project, "lookupTicket", source="tools/lookup_ticket.as")

Agent(project, "supportAgent",
instructions="You answer questions about support tickets.",
tools=[lookup],
table=tickets,
model=model)

The ID you give each resource (tickets, lookupTicket, supportAgent) is its logicalId. Keep it stable. Renaming it means delete and create.

Project layout​

autessa.config.py | autessa.config.ts | a Java AutessaProject class | autessa.yaml # your resources
autessa.stages.yaml # the tenants you deploy to
tools/*.as # AutessaScript tool sources
types/*.as # shared AutessaScript types
apps/<name>/ # React app sources
.autessa/ # build output (add to .gitignore)

See Project files for every file.

Deploy keys​

The CDK uses a deploy key, not a normal API key. See Keys for which key each package needs.

  • A deploy key belongs to one company (tenant).
  • It carries scopes: DEPLOY_DIFF, DEPLOY_PULL, DEPLOY_APPLY, DEPLOY_ROLLBACK, MODEL_TURN for chatting with a project's agents on your machine, and HARNESS_CHAT for chatting with them in the stage's tenant.
  • Company admins create, rotate and revoke deploy keys, in Autessa under Settings → Deploy keys or from the terminal. In Autessa, DEPLOY_DIFF is called Preview changes, DEPLOY_APPLY Deploy, DEPLOY_PULL Download, DEPLOY_ROLLBACK Roll back, MODEL_TURN Run agents locally and HARNESS_CHAT Chat with agents from your machine.
  • Keys are read from environment variables, never from project files.
  • Give CI only the scopes it needs. A pull-request job needs DEPLOY_DIFF only.

From the terminal, signed in as a company admin:

autessa deploy-keys create --name "CI main" --scopes DEPLOY_DIFF,DEPLOY_APPLY --stageName production
autessa deploy-keys list
autessa deploy-keys rotate --keyId <keyId>
autessa deploy-keys revoke --keyId <keyId>

create and rotate print the secret once, so save it straight into your CI's secret store. Scripts, agents and apps can't run these commands. See API access for who can.

API reference​

Deploy API and Pipelines API.

Examples​

  • autessa-cdk-sample: a complete help desk app built with the CDK, ready to run locally and deploy to your tenant.
  • autessa-as-code-tenant: a whole tenant in TypeScript and Java, with a stages file and a GitHub workflow.