Tarsana docsDashboardMenu

Build your first image

In this quickstart you sign in to Tarsana with your email address, set up your organisation, get an API access token, and build a hardened Ubuntu image from a short spec. It takes about ten minutes, most of it waiting for the build.

Each step shows the task three ways: with the API from a terminal, in the Portal at app.tarsana.io, and from an AI agent over MCP. Pick the tab you like; the next page opens on the same one. For the API you need curl and a terminal, and the examples use jq to read answers; you can also read them by eye.

You do not need a password, and there is no separate sign-up: the first time you sign in, Tarsana creates your profile, and then you name your organisation, which creates your tenant.

Send your email address to request-sign-in-link. You do not need to sign in for this.

export EMAIL=you@example.com
curl -X POST https://api.tarsana.io/v1/sign-in-links \
  -H "Content-Type: application/json" \
  --data "{\"email\": \"$EMAIL\"}"

If it worked, you see where the link went and until when it works:

{
  "sent_to": "you@example.com",
  "delivery": {
    "transport": "smtp",
    "state": "accepted"
  },
  "expires_at": "2026-10-05T03:15:39Z"
}
  1. Open app.tarsana.io.
  2. Fill in Email address and press Send me a link.
  3. You see Check your inbox, with the address the link went to.

Your agent cannot do this step. The link arrives in your mailbox, and opening it is something only you can do. The MCP server also answers only a client that sends an API access token, and you create that token in step 4. Sign in with the API or in the portal.

Tarsana sends you an email with a sign-in link. The answer is the same whether or not you have signed in before. The link works once, for 15 minutes. If it does not arrive, check your spam folder, then ask for a new one.

The link in the email has two values in it: sign_in_link and sign_in_proof.

Send both values to complete-sign-in-link:

export SIGN_IN_LINK=paste-the-sign_in_link-value-from-the-link
export SIGN_IN_PROOF=paste-the-sign_in_proof-value-from-the-link
curl -X POST https://api.tarsana.io/v1/sign-in-links/complete \
  -H "Content-Type: application/json" \
  --data "{\"sign_in_link\": \"$SIGN_IN_LINK\", \"sign_in_proof\": \"$SIGN_IN_PROOF\"}"

If it worked, you see a session. The first time, profile_created is true, and onboarded is false because you have no tenant yet:

{
  "session": "YOUR-SESSION",
  "login": "you@example.com",
  "tenants": [],
  "profile_created": true,
  "onboarded": false,
  "expires_at": "2026-10-05T03:15:39Z"
}
export SESSION=paste-the-session-value

A session lasts one hour. When it ends, ask for a new link.

Open the link in your browser. You see Sign in to Tarsana; press Sign in. Nothing happens until you press it, so a mail program that opens links to check them cannot use yours up.

The first time, the portal goes on to the next step by itself. The portal keeps the session for you; when it ends, you sign in again with a new link.

Your agent cannot do this step; see step 1.

If the link was already used or is more than 15 minutes old, you get sign_in_refused. Go back to step 1 and ask for a new one.

3. Set up your organisation

Your organisation's name creates your tenant: your space in Tarsana, where your specs, images and servers belong. Its tenant ID is made from the name, for example acme for Acme. Your scripts send the tenant ID with every request. You cannot change it later. See tenant.

API

profile suggests a name and an ID, made from your email address:

curl https://api.tarsana.io/v1/profile \
  -H "X-Tarsana-Session: $SESSION"
{
  "login": "you@example.com",
  "onboarded": false,
  "organisation_suggestion": "Acme",
  "tenant_suggestion": "acme"
}

To check another ID first, use check-tenant-id. Then create your tenant with create-tenant. Leave out tenant_id to use the one made from the name.

curl -X POST https://api.tarsana.io/v1/tenants \
  -H "X-Tarsana-Session: $SESSION" \
  -H "Content-Type: application/json" \
  --data '{"organisation_name": "Acme"}'

If it worked, you see your tenant and a new session that includes it:

{
  "tenant": "acme",
  "organisation_name": "Acme",
  "membership_role": "owner",
  "session": "YOUR-SESSION",
  "tenants": [
    "acme"
  ],
  "expires_at": "2026-10-05T03:15:39Z"
}

The session you sent has ended, so use the new one from now on:

export SESSION=paste-the-new-session-value
export TENANT=acme

Portal

You see Set up your organisation. Organisation name is filled in from your email address when it can be; change it if you like. Tenant ID follows the name as you type, and you can edit it. Press Create organisation.

You see Your dashboard.

MCP

Your agent cannot do this step. Creating a tenant needs a person who is signed in, and your agent connects with an access token, which you create in the next step.

If the ID is taken or not allowed, you get tenant_taken or tenant_refused, and nothing is created. The portal shows a free ID in its place; with the API, check-tenant-id suggests one in alternative.

4. Create an API access token

Scripts and MCP clients use a long-lived access token instead of a session.

API

Create one with issue-access-token:

curl -X POST https://api.tarsana.io/v1/access-tokens \
  -H "X-Tarsana-Session: $SESSION" \
  -H "Content-Type: application/json" \
  --data '{"token_label": "quickstart"}'
{
  "access_token": "YOUR-ACCESS-TOKEN",
  "token_id": "67e94a06c977c24c",
  "expires_at": "2027-01-03T02:15:39Z"
}

Every request from here on sends it in the X-Tarsana-Access-Token header, together with your tenant ID in X-Tarsana-Tenant.

export ACCESS_TOKEN=paste-the-access_token-value

Portal

The portal uses your session, so you need a token only for a script or an agent. To create one, choose All operations, then Create an API access token. Fill in token_label with a name that says what the token is for, such as my-agent, press Review and then Confirm and send.

MCP

Create the token with the API or in the portal, then connect your MCP client with it as the MCP page shows. From step 6 on, your agent can do each step itself.

5. Write a spec

Save this as spec.json. It asks for Ubuntu 24.04 (noble) from a fixed package snapshot, with the baseline hardening profile and nothing else installed. Put your own tenant ID in metadata.tenant. Every line of a spec, and what else can go in one, is in the Spec reference.

You use the same spec in every tab: the portal takes it pasted into a form, and your agent takes it from the file or from your message.

The placement says where servers made from this spec will run: here a Hetzner Cloud cpx12 in Nuremberg. It does not change the image, and you need it only when you run the image on your provider. Keep it in now: Tarsana keeps the placement of the first submission of a spec.

{
  "schema_version": "2.0",
  "metadata": {"name": "web", "tenant": "acme"},
  "distro": "ubuntu",
  "snapshot_id": "20260715T000000Z",
  "base_ref": "noble",
  "hardening_profile": "tarsana-baseline",
  "policy_class": "baseline",
  "placement": {"provider": "hetzner-cloud", "server_type": "cpx12", "region": "nbg1"}
}

6. Check the spec

validate runs every check that a submission runs, and stores nothing.

API

curl -X POST "https://api.tarsana.io/v1/tenants/$TENANT/specs/validate" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT" \
  -H "Content-Type: application/json" \
  --data @spec.json

If the spec is good, valid is true and every gate says pass:

{
  "valid": true,
  "spec_hash": "sha256:cdff062988d4722b2ff052c97ebefb8b571858c493ce47b159df73b1c88809b1",
  "problems": []
}

Portal

Choose All operations, then Check a spec without submitting it. Fill in tenant with your tenant ID, paste the spec into body, and press Send.

MCP

Ask your agent:

Your agent calls the validate tool:

{
  "method": "tools/call",
  "params": {
    "name": "validate",
    "arguments": {
      "tenant": "acme",
      "body": {
        "...": "the contents of spec.json"
      }
    }
  }
}

If valid is false, problems lists what to fix, each with the path in your spec where it is.

7. Submit it

submit stores the spec and starts the build.

API

curl -X POST "https://api.tarsana.io/v1/tenants/$TENANT/specs" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT" \
  -H "Content-Type: application/json" \
  --data @spec.json
{
  "submission": "sha256:cdff062988d4722b2ff052c97ebefb8b571858c493ce47b159df73b1c88809b1",
  "state": "accepted",
  "created": true,
  "pipeline": {
    "job": "j-bbdde9adc372c296",
    "state": "dispatched",
    "created": true,
    "what": "A sentence about the build's progress."
  }
}
export SUBMISSION=sha256:paste-the-rest-of-the-submission-value

Portal

On Your dashboard, choose Build your first image (later it reads Build a new image). The form Submit a spec to build an image opens with tenant filled in. Paste the spec into body, press Review, then Confirm and send.

MCP

Ask your agent:

Your agent calls the submit tool:

{
  "method": "tools/call",
  "params": {
    "name": "submit",
    "arguments": {
      "tenant": "acme",
      "body": {
        "...": "the contents of spec.json"
      }
    }
  }
}

8. Follow the build

A build can take several minutes.

API

Ask for the status until pipeline.state is succeeded.

curl "https://api.tarsana.io/v1/tenants/$TENANT/submissions/$SUBMISSION" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT"
{
  "state": "accepted",
  "pipeline": {
    "job": "j-bbdde9adc372c296",
    "state": "dispatched",
    "created": true,
    "what": "A sentence about the build's progress."
  },
  "artifacts": [
    "artifacts",
    "provenance",
    "sbom",
    "spec"
  ]
}

pipeline.state moves from dispatched to pending to succeeded. If it ends in failed or rejected, pipeline.what says why.

Portal

Your build is listed under Recent builds. Its Build column moves from Waiting to start to Building to Ready; reload the page to see it move on. Details shows the full status, and if the build ends as Failed or Refused by a check, it says why.

MCP

Ask your agent:

It asks for the status until the build has succeeded:

Your agent calls the status tool:

{
  "method": "tools/call",
  "params": {
    "name": "status",
    "arguments": {
      "tenant": "acme",
      "submission": "sha256:cdff062988d4722b2ff052c97ebefb8b571858c493ce47b159df73b1c88809b1"
    }
  }
}

9. See what the build produced

When the build has succeeded, fetch the list of outputs: the image, its SBOM and its signed provenance, each with its SHA-256 digest.

API

curl "https://api.tarsana.io/v1/tenants/$TENANT/submissions/$SUBMISSION/artifacts" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT"
{
  "artifact": "artifacts",
  "content": {
    "schema": "tarsana.submission-artifacts/v1",
    "job": "j-bbdde9adc372c296",
    "published_at": "2026-10-05T03:01:12Z",
    "image": {
      "format": "raw-verity",
      "digest": "sha256:0f1e2d3c...",
      "size_bytes": 734003200,
      "verity_roothash": "9c4b..."
    },
    "sbom": {
      "format": "CycloneDX",
      "digest": "sha256:fb917071...",
      "bytes": 48213
    },
    "provenance": {
      "format": "in-toto-dsse",
      "digest": "sha256:eeee...",
      "bytes": 1161
    },
    "release": {
      "version": "20261005-030112",
      "plain_sha256": "9487214a...",
      "plain_size": 2147483648
    }
  }
}

Portal

Your build is now listed under Images ready to use. For the list of outputs, choose All operations, then Download a record of a submission. Fill in tenant and submission, choose artifacts in artifact, and press Send. To download the image itself, choose Get a download link on its row.

MCP

Ask your agent:

Your agent calls the fetch tool:

{
  "method": "tools/call",
  "params": {
    "name": "fetch",
    "arguments": {
      "tenant": "acme",
      "submission": "sha256:cdff062988d4722b2ff052c97ebefb8b571858c493ce47b159df73b1c88809b1",
      "artifact": "artifacts"
    }
  }
}

If you ask too early, you get no_such_artifact with the state of the build; ask again later.

Next steps

View this page as Markdown