
Access Rules page with the three default rules
How rules are evaluated
- A user can see a record if any enabled rule matches them for that data type. Access is the union of all matching rules, so adding a rule can only widen access.
- Rules are evaluated separately for Traces and Metrics. A rule that grants only Metrics does not expose any traces.
- Disabled rules are ignored.
Default rules
Every tenant starts with three rules. They are regular rules, so you can edit, disable, or delete them.team:everyone is used to match all users, but it is never treated as a team for data scoping. A team_data rule gives access only to the real teams a user belongs to, not to the whole organization.Data scopes

Scope options when adding a rule
Team data vs team applications data
Both scopes are resolved from the teams the user belongs to. The difference is whose requests they include:- Team Applications Data covers only traffic from applications, meaning virtual accounts whose owner is the team. Teammates’ personal requests (for example, prompts sent from the Playground or with a personal access token) stay private.
- Team Data covers the same application traffic plus every teammate’s personal requests.
Create a rule
Open the form
Name the rule
team-managers-team-data) and an optional description. The ID must be unique and start with a letter. It can contain letters, digits, ., _, and -.Select subjects
tenant-admin or team-manager.
Selecting a role as the rule subject
Choose data types and scope
Save
Filters for all data
With theall_data scope, you can add filters to limit access to a slice of traffic. Multiple filters must all match.

All Data scope restricted to two applications with a metadata filter
Common use cases
Give team managers access to their team data
To let team managers review everything their team sends through the gateway, create a rule with theteam-manager role as the subject and Team Data as the scope.

Rule granting team managers access to their teams' data
payments and is a regular member of platform gets payments team data from this rule, not platform.
team-manager cannot be combined with the all_data scope. Use team_data, team_virtual_account_data, or own_data.Keep teammates’ prompts private
The defaultdefault-everyone-team-data rule lets every member read their teammates’ traces. To limit members to their team’s application traffic while managers keep full visibility:
- Edit
default-everyone-team-dataand change its scope to Team Applications Data (team_virtual_account_data). - Add the team manager rule above.
default-everyone-own-data.
Share team dashboards without exposing traces
Grant a team Metrics only. Members can see usage and cost dashboards for the team without reading request or response content.Give a team access to specific applications
Useall_data with a metadata filter, for example so a support team can see all traffic from support applications regardless of who made the request.
X-TFY-METADATA header, for example X-TFY-METADATA: {"application_name": "support-agent"}.
Let a virtual account read metrics
A service that queries the Metrics API with a virtual account token, such as a usage dashboard, is matched against the rules like any other caller. A virtual account cannot be a rule subject, so you grant it access through a role.- Role, not team. A
role:<role-name>subject matches a virtual account that holds that role through a tenant-level role binding. Ateam:<team-name>subject never matches a virtual account, because a virtual account is not a member of a team. all_datascope.own_datareturns only requests the virtual account itself made, and a dashboard that only reads metrics has made none. The team scopes need team membership. Useall_dataand narrow it with filters.
-
Create or pick a role and bind it to the virtual account at the tenant level:
-
Add a rule for that role. Limit it to metrics, and to the traffic the service should see:
200 with an empty result, so a missing or disabled rule and an unmatched role look the same as a time range with no traffic.
Manage rules as YAML
Click the menu next to Add Rule and select Edit as YAML to view or edit all rules at once. You can also apply the same manifest through the CLI or GitOps.Best practices
- Review the defaults first. Out of the box, every member can read their teammates’ traces. If prompts can contain sensitive data, switch
default-everyone-team-datatoteam_virtual_account_dataor to Metrics only. - Assign virtual account owners. Team scopes only include applications whose virtual accounts are owned by the team.
- Use roles instead of individual users.
role:tenant-adminandrole:team-managerstay correct as people join, leave, or change teams. - Grant the narrowest scope that works. Prefer
own_data,team_virtual_account_data, orteam_dataoverall_data, and always add filters toall_datarules for non-admins. - Separate Traces from Metrics. Traces contain request and response content, while Metrics do not. Grant Metrics broadly and Traces only where needed.
- Disable before you delete. Toggling a rule off lets you confirm nobody loses needed access, and deleting a rule revokes access immediately.
- Use descriptive IDs and descriptions so the purpose of each rule is clear during audits.
Troubleshooting
A user can't see data they expect
A user can't see data they expect
- Confirm a matching rule is enabled and includes the right data type.
- For team scopes, confirm the user is a member of the team and, for application traffic, that the virtual account is owned by that team.
- For
role:team-managerrules, confirm the user is a manager of that specific team. - For
all_datawith filters, confirm requests actually carry the metadata key and value.
A virtual account token gets an empty result from the Metrics API
A virtual account token gets an empty result from the Metrics API
- The request succeeds with
200and no rows when no enabled rule matches the virtual account. - Confirm the rule’s subject is a
role:the virtual account holds through a tenant-level role binding.team:subjects never match a virtual account. - Confirm the rule is
enabled: trueand its scope isall_data. Withown_datathe virtual account only sees requests it made itself. - A role binding can take a few seconds to apply. Call
GET /api/svc/v1/session/get-mewith the same token to see the roles the token currently carries. - See Let a virtual account read metrics.
A user can see more than expected
A user can see more than expected
default-everyone-team-data, and narrow or disable the broader rule instead of adding a new one.Saving a rule with the team-manager role fails
Saving a rule with the team-manager role fails
all_data. Change the scope to team_data, team_virtual_account_data, or own_data.