[Blog](/blog/.md)

# Temporary credentials travel with requests

Tigris temporary credentials are short-lived, bucket-scoped keys that carry their own sealed permissions, so they work in every region the moment you mint them.

Authors

[![Xe Iaso](https://avatars.githubusercontent.com/u/529003?v=4)](https://xeiaso.net)

[Xe Iaso](https://xeiaso.net)

Senior Cloud Whisperer

[![Himank Chaudhary](https://github.com/himank.png)](https://www.linkedin.com/in/himank-chaudhary-1937b958/)

[Himank Chaudhary](https://www.linkedin.com/in/himank-chaudhary-1937b958/)

Co-Founder @ Tigris Data

[![Mantas Mikšys](https://github.com/MantasMiksys.png)](https://github.com/MantasMiksys)

[Mantas Mikšys](https://github.com/MantasMiksys)

Member of Technical Staff

Published2026-12-01

Reading13

<!-- -->

min

Tags

[Engineering](/blog/tags/engineering/.md)[Security](/blog/tags/security/.md)[Authentication](/blog/tags/authentication/.md)

Contents

* [Why temporary credentials?](#why-temporary-credentials)
* [Pass-by-value credentials](#pass-by-value-credentials)
* [The meaty innards of a temporary credential](#the-meaty-innards-of-a-temporary-credential)
* [The data in the session token](#the-data-in-the-session-token)
* [Creating temporary credentials](#creating-temporary-credentials)
* [The price of stateless](#the-price-of-stateless)
* [Let us know how it works for you!](#let-us-know-how-it-works-for-you)

Securing your API keys is an annoying affair. We're all guilty of making one big credential and then reusing it across different agents and services because it's just *convenient*. Hell, I'm guilty of this even though I have enough SRE experience to know that doing so is a bad idea. What if it was easy to just make temporary credentials that you can use from anywhere and rest easy knowing that they will expire at some point?

This is why we've developed [Temporary Credentials](https://www.tigrisdata.com/docs/iam/temporary-credentials/). They're like the wristband at a music festival. Our STS endpoint checks your admission ticket (an access key) at the door, gives your agent the wristband, and then it's off to do whatever it wants and can get back into its bucket easily with just the wristband. The catch is that the wristband never stops being tied to your ticket. Every time your agent flashes it, Tigris checks your ticket too, so if you cancel the ticket, every wristband it got you is dead.

<!-- -->

## Why temporary credentials?[​](#why-temporary-credentials "Direct link to Why temporary credentials?")

If it's not easy to do things the "right way", people won't do it. They just won't. You can do all the user education you want, but if the UX sucks nobody will take the time to implement it.

Tigris temporary credentials let you just get an access key with a single API call:

* Tigris CLI
* JavaScript

```
tigris credentials temporary my-bucket --name ci-upload --access readwrite --duration 1h
```

`--access` grants the read actions, the write actions, or both. Use `--actions` to list exact actions, or `--policy` for a policy file. See [`tigris credentials temporary`](https://www.tigrisdata.com/docs/cli/credentials/temporary/).

```
import { createTemporaryCredentials } from "@tigrisdata/iam";



const { data: creds, error } = await createTemporaryCredentials("ci-upload", {

  bucket: "my-bucket",

  access: "readwrite", // "read", "write", or "readwrite"

  durationSeconds: 3600,

});

if (error) throw error;
```

[`@tigrisdata/iam`](https://www.npmjs.com/package/@tigrisdata/iam) signs the request with the access key in `TIGRIS_STORAGE_ACCESS_KEY_ID` and `TIGRIS_STORAGE_SECRET_ACCESS_KEY`. It returns `accessKeyId`, `secretAccessKey`, `sessionToken`, and `expiration`.

Already have the AWS SDKs wired up everywhere? Those work too, and I'll get to them [further down](#creating-temporary-credentials).

This means that your agent can operate on a bucket fork and then you can be sure that agent never gets access to anything but that fork:

FIG 01one fork, one credential, one agent run

```
  ┌───────────┐                 ┌──────────┐                   ┌─────────┐
  │  runtime  │                 │  Tigris  │                   │  agent  │
  └─────┬─────┘                 └─────┬────┘                   └────┬────┘
        │                             │                             │
        │── fork models as run-42 ───▶│                             │
        │── mint cred: run-42, 1h ───▶│                             │
        │◀──── tsid + tssec + token ──│                             │
        │── start the agent with the credential ───────────────────▶│
        │                             │                             │
        │                             │◀───── PUT run-42/out.json ──│
        │                             │── 200 OK ──────────────────▶│
        │                             │◀────── GET models/weights ──│
        │                             │── 403 AccessDenied ────────▶│
        │                             │                             │
        │── delete fork run-42 ──────▶│                             │
        │                             │◀──── PUT run-42/late.json ──│
        │                             │── 403, fork is gone ───────▶│
        │                             │                             │
```

01/08the runtime forks the models bucket for this one run↺ replay

We think that this will let you have better granular workload identity and reduce the splash damage from credential reuse.

## Pass-by-value credentials[​](#pass-by-value-credentials "Direct link to Pass-by-value credentials")

In programming we have two paradigms for how data propagates through the system: pass by reference and pass by value. Traditionally this means the difference between getting a pointer to a value in memory as a function argument and copying all of the data as a function argument.

This is similar to what you do with an API key lookup in the database. You check if the API key is valid and what user it references:

FIG 02an access key is a name that Tigris looks up

```
 request                     Tigris, any region          FoundationDB
┌──────────────────┐        ┌──────────────────┐        ┌──────────────────┐
│ GET /models/x    │        │ find tid_ABC…    │───────▶│ tid_ABC…         │
│ Authorization:   │        │ check the sig    │        │ user, org        │
│ tid_ABC… + sig   │───────▶│ check the ACLs   │◀───────│ bucket ACLs      │
└──────────────────┘        └──────────────────┘        └──────────────────┘
 
// the request names a key. what that key may do lives in
// the database, so the request has to go and look it up.
```

Most of the time this works well enough. I'd be willing to bet that a lot of you have implemented things like this already. Tigris does it in a global active-active setup where any region can be authoritative for any access key, user, bucket, object, or other primitive. When you create an access key, its record gets stored and replicated, and the key works in every region right away.

That's totally fine when keys are things humans make by hand every so often. It gets silly at machine speed. If every agent run gets its own bucket fork and its own credential, every one of those credentials is another record that has to be stored, replicated to every region, looked up, and cleaned up after the run. That's a lot of bookkeeping for a key that might only live for 15 minutes.

So temporary credentials go the other way: they're passed by value. Minting one stores nothing, so there's nothing to replicate and nothing to clean up, and the credential works in every region the moment you get it. The record that would have gone in the database travels with each request instead, sealed inside the session token:

FIG 03the same request, by reference and by value

```
access key: pass by reference
┌──────────────────┐        ┌──────────────────┐        ┌──────────────────┐
│ tid_… + sig      │───────▶│ look up tid_…    │───────▶│ tid_… record     │
│ just a name      │        │ then decide      │◀───────│ one per key      │
└──────────────────┘        └──────────────────┘        └──────────────────┘
// one record per key: stored, replicated, looked up, cleaned up
 
temporary credential: pass by value
┌──────────────────┐        ┌──────────────────┐        ┌──────────────────┐
│ tsid_… + sig     │───────▶│ decrypt token    │        │ no tsid_… row    │
│ session token    │───────▶│ check issuer     │───────▶│ issuer key       │
└──────────────────┘        └──────────────────┘        └──────────────────┘
// no record for the credential. its issuing key still gets checked
```

There's one thing the token doesn't replace, though: the key that issued it. Every request made with a temporary credential is also checked as if that access key made it. This is load-bearing. It's why a temporary credential can never do more than its issuer, and it's how you can kill a whole batch of them by disabling one key.

## The meaty innards of a temporary credential[​](#the-meaty-innards-of-a-temporary-credential "Direct link to The meaty innards of a temporary credential")

At first glance, what I just said probably sounds a bit insane to you. "What, you just include the database record with the request? How in the seven hells is that secure at all?? Isn't this just a gentrified JWT?" Yeah, it's similar to a JWT, but it's fundamentally misuse resistant in ways that [JWTs simply are not](https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-bad-standard-that-everyone-should-avoid).

The trick is that the database record is encrypted by Tigris when you create it, returned as a session token, and then that session token is validated against your temporary credentials before any API calls can happen.

Here's what an example temporary credential keypair looks like:

```
$ t3 credentials temporary xe-models --name ci-upload --access readwrite --duration 1h --export --for aws

export AWS_ACCESS_KEY_ID='tsid_...'

export AWS_SECRET_ACCESS_KEY='tssec_...'

export AWS_SESSION_TOKEN='tsts1....'

export AWS_ENDPOINT_URL_S3='https://t3.storage.dev'

export AWS_ENDPOINT_URL_IAM='https://iam.storageapi.dev'

export AWS_REGION='auto'
```

The access key ID and secret access key are used [mostly the same way they are in SigV4 auth normally](https://www.tigrisdata.com/blog/sigv4/), so we'll just skip over that. The secret access key is derived from the session token with a key that only Tigris holds, so seeing the session token doesn't give you the secret.

Now for the really interesting part: the session token. When you mint one yourself, you'll see a long, very high entropy string (we've cut it short here) that you are undoubtedly going to put through a base64 decoder and `xxd` only to get random data back. That's because the session token is actually a sealed record, or an encrypted value that gets decrypted by the platform as part of the process of using it. If the decryption fails, the request fails, and forging access to things you shouldn't have access to is impossible unless all of cryptography is broken (in which case we hope Tigris is not high on the list of targets).

## The data in the session token[​](#the-data-in-the-session-token "Direct link to The data in the session token")

Under the covers, the session token holds the data that would normally go in a FoundationDB record, including but not limited to:

* The access key ID that minted the credential and what kind of access key it was. Every request is also checked as if that key made it, so if you disable or delete that key, every temporary credential it minted stops working too.
* The bucket name and the actions from the IAM policy that was passed to the STS `GetFederationToken` call. This is used so the platform can finely limit access to just the actions you want the temporary credential to take at mint time.
* The name, issue, and expiry time of the credential. The first two are used for audit logging, and the expiration time is used to make sure that every temporary credential is self-deleting.

Then you submit the session token with your S3 requests and if all goes well your credential works! If not then your data is secure, even from yourself!

## Creating temporary credentials[​](#creating-temporary-credentials "Direct link to Creating temporary credentials")

In order to create one, you poke our new STS endpoint at `https://sts.storage.dev` and issue a [`GetFederationToken`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetFederationToken.html) call with an IAM policy that names one bucket and the actions you want. Every AWS SDK can do this with only the endpoint changed. With the AWS CLI, you can set `AWS_ENDPOINT_URL_STS=https://sts.storage.dev` instead of passing `--endpoint-url`:

* AWS CLI
* JavaScript
* Python
* Go

```
aws sts get-federation-token \

  --endpoint-url https://sts.storage.dev \

  --region auto \

  --name ci-upload \

  --duration-seconds 3600 \

  --policy '{

    "Version": "2012-10-17",

    "Statement": [

      {

        "Effect": "Allow",

        "Action": ["s3:GetObject", "s3:PutObject", "s3:ListBucket"],

        "Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"]

      }

    ]

  }'
```

```
import { GetFederationTokenCommand, STSClient } from "@aws-sdk/client-sts";



const policy = {

  Version: "2012-10-17",

  Statement: [

    {

      Effect: "Allow",

      Action: ["s3:GetObject", "s3:PutObject", "s3:ListBucket"],

      Resource: ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"],

    },

  ],

};



const sts = new STSClient({

  endpoint: "https://sts.storage.dev",

  region: "auto",

});



const { Credentials: creds } = await sts.send(

  new GetFederationTokenCommand({

    Name: "ci-upload",

    DurationSeconds: 3600,

    Policy: JSON.stringify(policy),

  })

);
```

```
import json



import boto3



policy = {

    "Version": "2012-10-17",

    "Statement": [

        {

            "Effect": "Allow",

            "Action": ["s3:GetObject", "s3:PutObject", "s3:ListBucket"],

            "Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"],

        }

    ],

}



sts = boto3.client("sts", endpoint_url="https://sts.storage.dev", region_name="auto")

creds = sts.get_federation_token(

    Name="ci-upload",

    DurationSeconds=3600,

    Policy=json.dumps(policy),

)["Credentials"]
```

```
import (

	"log"



	"github.com/aws/aws-sdk-go-v2/aws"

	"github.com/aws/aws-sdk-go-v2/config"

	"github.com/aws/aws-sdk-go-v2/service/sts"

)



const policy = `{

  "Version": "2012-10-17",

  "Statement": [

    {

      "Effect": "Allow",

      "Action": ["s3:GetObject", "s3:PutObject", "s3:ListBucket"],

      "Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"]

    }

  ]

}`



cfg, err := config.LoadDefaultConfig(ctx)

if err != nil {

	log.Fatal(err)

}



stsClient := sts.NewFromConfig(cfg, func(o *sts.Options) {

	o.BaseEndpoint = aws.String("https://sts.storage.dev")

	o.Region = "auto"

})



out, err := stsClient.GetFederationToken(ctx, &sts.GetFederationTokenInput{

	Name:            aws.String("ci-upload"),

	DurationSeconds: aws.Int32(3600),

	Policy:          aws.String(policy),

})

if err != nil {

	log.Fatal(err)

}

creds := out.Credentials
```

What you get back is an access key ID, a secret access key, and a session token. Use them like any other credential, just with the session token set next to the other two. The [docs](https://www.tigrisdata.com/docs/iam/temporary-credentials/) have examples of using them with each SDK.

Here's a couple infrastructure prompt ideas on how you can use this:

* Mint a new credential on a bucket fork per agent call, then delete the bucket fork at the end of the run and the credentials are useless.
* Make your internal secret management service mint access keys for your services on demand and rotate them out as they expire.
* Run your agents with their route to Tigris detoured through a service that handles the dynamic key rotation parts for you.

Personally I think the coolest application for this is having credentials constantly rolling so that your services never have persistent Tigris credentials, but they have to constantly request new ones. It's a lot like SSH certificates if you've ever dealt with those.

FIG 04credentials that roll over before they run out

```
  ┌───────────┐               ┌───────────────┐               ┌──────────┐
  │  service  │               │  cred broker  │               │  Tigris  │
  └─────┬─────┘               └───────┬───────┘               └─────┬────┘
        │                             │                             │
        │                             │── mint, valid 1h ──────────▶│
        │                             │◀───────────────── cred #1 ──│
        │◀───────────────── cred #1 ──│                             │
        │── S3 calls with cred #1 ─────────────────────────────────▶│
        │                             │                             │
        │                             │ 45 minutes later            │
        │                             │── mint, valid 1h ──────────▶│
        │                             │◀───────────────── cred #2 ──│
        │◀───────────────── cred #2 ──│                             │
        │── S3 calls with cred #2 ─────────────────────────────────▶│
        │                             │                             │
        │                             │            cred #1 expires  │
        │                             │                             │
```

01/06the broker mints a credential that is good for one hour↺ replay

## The price of stateless[​](#the-price-of-stateless "Direct link to The price of stateless")

In my experience, this works pretty great. Your credentials automatically self-terminate, and when one leaks anyway, the blast radius is one bucket for however long that credential has left to live.

The main tradeoff you make here is that temporary credentials can't be arbitrarily revoked, like with [presigned URLs](https://www.tigrisdata.com/blog/presigned-urls-security-vuln/). Once you mint them, they are valid until they expire or the access key that minted them is disabled or deleted. In the worst possible scenario, you disable or delete the access key that minted all your credentials. That kills the leaked ones, but it also kills every other credential that key ever minted.

None of this is instant, either. It takes about 10 minutes to reach every credential the key minted. I'd reach for disabling the key over deleting it, because you can turn a disabled key back on once the fire is out. If you only take some permissions away from the issuing key, its credentials lose that access within 30 minutes.

We think about this as an explicit tradeoff between latency, simplicity, and security. If you want to use this in your stack, please ask a security expert (or your AI agent with a skill that acts like one) to talk you through the advantages and disadvantages of this for your use case.

In practice credentials being locked down to a single bucket for a set expiry time isn't that bad of an issue, but again this depends on the paranoia level of your use case.

Then there's the fine print:

* A temporary credential works on exactly one bucket. You can't scope it to an object prefix such as `my-bucket/uploads/*`.
* It lasts from 15 minutes to 36 hours. `GetFederationToken` defaults to 12 hours, and the Tigris CLI defaults to 1 hour.
* Tigris accepts it for up to 5 minutes after it expires, to allow for clock differences between you and us. Don't treat the expiry time as an exact cutoff.
* It can't list or create buckets, call the IAM API, or mint more temporary credentials.

The policy you mint a temporary credential with can grant these IAM actions:

| Read actions                    | Write actions                   |
| ------------------------------- | ------------------------------- |
| `s3:GetObject`                  | `s3:PutObject`                  |
| `s3:GetObjectVersion`           | `s3:DeleteObject`               |
| `s3:GetObjectTagging`           | `s3:DeleteObjectVersion`        |
| `s3:GetObjectVersionTagging`    | `s3:PutObjectTagging`           |
| `s3:GetObjectAttributes`        | `s3:DeleteObjectTagging`        |
| `s3:ListBucket`                 | `s3:PutObjectVersionTagging`    |
| `s3:ListBucketVersions`         | `s3:DeleteObjectVersionTagging` |
| `s3:GetBucketLocation`          | `s3:AbortMultipartUpload`       |
| `s3:GetBucketVersioning`        | `s3:ListMultipartUploadParts`   |
| `s3:ListBucketMultipartUploads` |                                 |

These are actions, not individual S3 API calls, and one action can cover several calls. `s3:PutObject`, for example, covers copies and the whole multipart upload flow: creating the upload, uploading parts, and completing it.

In practice, this matches about 99% of the most common API calls. If you need to do something outside this list, please reach out to us so we can learn more about your use case!

## Let us know how it works for you\![​](#let-us-know-how-it-works-for-you "Direct link to Let us know how it works for you!")

Temporary credentials are our first step towards making Tigris authentication work for you instead of having to work around it for your needs. We really hope that you enjoy them and would love to hear what you build!

We're going to continue working on making Tigris better for everyone. Check out [our Discord community](https://community.tigrisdata.com/) to talk with other users and share in your victories. We'll cheer along with you!

Stay safe all! Happy holidays and happy new year!

Hand your agents a wristband, not the main keypair

Mint short-lived, bucket-scoped credentials with one API call. They work in every region the moment you make them and expire on their own.

[Read the temporary credentials docs→](https://www.tigrisdata.com/docs/iam/temporary-credentials/)

## Share

[X](https://twitter.com/intent/tweet?text=Check%20out%20this%20post%20on%20the%20%40tigrisdata%20blog%3A%20Temporary%20credentials%20travel%20with%20requests%0A%0A\&url=https%3A%2F%2Fwww.tigrisdata.com%2Fblog%2Ftemp-creds)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fwww.tigrisdata.com%2Fblog%2Ftemp-creds\&t=Temporary%20credentials%20travel%20with%20requests)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.tigrisdata.com%2Fblog%2Ftemp-creds)[Email](mailto:?subject=Temporary%20credentials%20travel%20with%20requests\&body=Hey!%0A%0ACheck%20out%20this%20article%20on%20the%20Tigris%20blog%3A%20https%3A%2F%2Fwww.tigrisdata.com%2Fblog%2Ftemp-creds)Copy link
