> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a trust rule

> Returns one trust rule by ID.

> [!NOTE]
>
> [Workload identity federation](https://docs.baseten.co/organization/workload-identity.md) is in **Private Preview**.


## OpenAPI

````yaml get /v1/access/trust_rules/{trust_rule_id}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/access/trust_rules/{trust_rule_id}:
    parameters:
      - $ref: '#/components/parameters/trust_rule_id'
    get:
      summary: Gets a trust rule
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTrustRuleV1'
      x-codeSamples:
        - lang: bash
          source: |
            curl --request GET \
            --url https://api.baseten.co/v1/access/trust_rules/{trust_rule_id} \
            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/access/trust_rules/{trust_rule_id}"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "GET",
                url,
                headers=headers,
                json={}
            )

            print(response.text)
components:
  parameters:
    trust_rule_id:
      schema:
        type: string
      name: trust_rule_id
      in: path
      required: true
  schemas:
    AccessTrustRuleV1:
      description: Which tokens from an identity provider may act as a service account.
      properties:
        id:
          description: Trust rule ID. Workloads pass it when they exchange a token.
          title: Id
          type: string
        name:
          description: Name, unique in the organization
          title: Name
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Description
          title: Description
        identity_provider_id:
          description: The identity provider whose tokens it accepts
          title: Identity Provider Id
          type: string
        identity_provider_name:
          description: Name of the identity provider
          title: Identity Provider Name
          type: string
        service_account_id:
          description: The service account its tokens act as
          title: Service Account Id
          type: string
        service_account_name:
          description: Name of the service account
          title: Service Account Name
          type: string
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The service account's team. Null for an organization service
            account.
          title: Team Id
        team_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Name of the service account's team. Null for an organization service
            account.
          title: Team Name
        condition:
          description: >-
            A CEL expression over the token's `claims` that must evaluate to
            true. It must pin a specific `claims.sub` in a top-level `&&`
            clause, plus any provider-required checks. Up to 4,096 characters.
          examples:
            - >-
              claims.repository_owner_id == '12345' &&
              claims.sub.startsWith('repo:acme/models:') && claims.ref ==
              'refs/heads/main'
          title: Condition
          type: string
        audience:
          description: >-
            The token's `aud` must equal this, or contain it when `aud` is a
            list. Up to 1,024 characters.
          title: Audience
          type: string
        max_access_token_lifetime_seconds:
          description: Longest lifetime of a token the rule issues, in seconds
          title: Max Access Token Lifetime Seconds
          type: integer
        last_used_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: >-
            Last time a request authenticated with a token the rule issued, to
            within an hour. Null until the first.
          title: Last Used At
        created_by:
          description: ID of the user who created the rule
          title: Created By
          type: string
        created_at:
          description: Time the rule was created
          format: date-time
          title: Created At
          type: string
        updated_at:
          description: Time the rule was last updated
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - name
        - identity_provider_id
        - identity_provider_name
        - service_account_id
        - service_account_name
        - condition
        - audience
        - max_access_token_lifetime_seconds
        - created_by
        - created_at
        - updated_at
      title: AccessTrustRuleV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````