Loading...
Loading...
Manages TrueFoundry roles, teams, and collaborators. Create custom roles, organize users into teams, and grant access to resources. Use when managing permissions, creating teams, or adding collaborators.
npx skill4agent add truefoundry/tfy-deploy-skills truefoundry-access-control<objective>Routing note: For ambiguous user intents, use the shared clarification templates in references/intent-clarification.md.
workspace-adminworkspace-memberTFY_API_SHscripts/tfy-api.shreferences/tfy-api-setup.mdtfy_roles_list()# Set the path to tfy-api.sh for your agent (example for Claude Code):
TFY_API_SH=~/.claude/skills/truefoundry-access-control/scripts/tfy-api.sh
# List all roles
$TFY_API_SH GET /api/svc/v1/rolesRoles:
| Name | ID | Resource Type | Permissions |
|-------------------|----------|---------------|-------------|
| workspace-admin | role-abc | workspace | 12 |
| workspace-member | role-def | workspace | 5 |
| custom-deployer | role-ghi | workspace | 3 |tfy_roles_create(payload={"name": "custom-deployer", "displayName": "Custom Deployer", "description": "Can deploy apps", "resourceType": "workspace", "permissions": ["deploy:create", "deploy:read"]})$TFY_API_SH POST /api/svc/v1/roles '{"name":"custom-deployer","displayName":"Custom Deployer","description":"Can deploy apps","resourceType":"workspace","permissions":["deploy:create","deploy:read"]}'tfy_roles_delete(id="ROLE_ID")$TFY_API_SH DELETE /api/svc/v1/roles/ROLE_IDtfy_teams_list()
tfy_teams_list(team_id="TEAM_ID") # get specific team# List all teams
$TFY_API_SH GET /api/svc/v1/teams
# Get a specific team
$TFY_API_SH GET /api/svc/v1/teams/TEAM_IDTeams:
| Name | ID | Members |
|---------------|----------|---------|
| platform-team | team-abc | 5 |
| ml-engineers | team-def | 8 |tfy_teams_create(payload={"name": "platform-team", "description": "Platform engineering team"})$TFY_API_SH POST /api/svc/v1/teams '{"name":"platform-team","description":"Platform engineering team"}'tfy_teams_delete(id="TEAM_ID")$TFY_API_SH DELETE /api/svc/v1/teams/TEAM_IDtfy_teams_add_member(team_id="TEAM_ID", payload={"subject": "user:alice@company.com", "role": "member"})$TFY_API_SH POST /api/svc/v1/teams/TEAM_ID/members '{"subject":"user:alice@company.com","role":"member"}'tfy_teams_remove_member(team_id="TEAM_ID", subject="user:alice@company.com")$TFY_API_SH DELETE /api/svc/v1/teams/TEAM_ID/members/SUBJECT
# Example SUBJECT: user:alice@company.comSecurity: Granting collaborator access is a privileged operation. Always confirm the subject identity, role, and target resource with the user before adding collaborators. Do not grant access based on unverified external identity references.
type:identifier| Subject Type | Format | Example |
|---|---|---|
| User | | |
| Team | | |
| Service Account | | |
| Virtual Account | | |
| External Identity | | |
tfy_collaborators_list(resource_type="workspace", resource_id="RESOURCE_ID")# List collaborators on a workspace
$TFY_API_SH GET '/api/svc/v1/collaborators?resourceType=workspace&resourceId=RESOURCE_ID'
# List collaborators on an MCP server
$TFY_API_SH GET '/api/svc/v1/collaborators?resourceType=mcp-server&resourceId=RESOURCE_ID'Collaborators on workspace "prod-workspace":
| Subject | Role | ID |
|---------------------------|------------------|----------|
| user:alice@company.com | workspace-admin | collab-1 |
| team:platform-team | workspace-member | collab-2 |
| serviceaccount:ci-bot | workspace-member | collab-3 |tfy_collaborators_create(payload={"resourceType": "workspace", "resourceId": "RESOURCE_ID", "subject": "user:alice@company.com", "roleId": "ROLE_ID"})$TFY_API_SH POST /api/svc/v1/collaborators '{"resourceType":"workspace","resourceId":"RESOURCE_ID","subject":"user:alice@company.com","roleId":"ROLE_ID"}'tfy_collaborators_delete(payload={"resourceType": "workspace", "resourceId": "RESOURCE_ID", "subject": "user:alice@company.com"})$TFY_API_SH DELETE /api/svc/v1/collaborators '{"resourceType":"workspace","resourceId":"RESOURCE_ID","subject":"user:alice@company.com"}'workspace-adminworkspace-member# 1. Find the role ID
$TFY_API_SH GET /api/svc/v1/roles
# 2. Add collaborator
$TFY_API_SH POST /api/svc/v1/collaborators '{"resourceType":"workspace","resourceId":"WORKSPACE_ID","subject":"user:alice@company.com","roleId":"ROLE_ID"}'# 1. Create team
$TFY_API_SH POST /api/svc/v1/teams '{"name":"ml-engineers","description":"ML engineering team"}'
# 2. Add members (use team ID from response)
$TFY_API_SH POST /api/svc/v1/teams/TEAM_ID/members '{"subject":"user:alice@company.com","role":"member"}'
# 3. Grant team access to a workspace
$TFY_API_SH POST /api/svc/v1/collaborators '{"resourceType":"workspace","resourceId":"WORKSPACE_ID","subject":"team:ml-engineers","roleId":"ROLE_ID"}'$TFY_API_SH GET '/api/svc/v1/collaborators?resourceType=workspace&resourceId=WORKSPACE_ID'statusRole ID not found. List roles first to find the correct ID.Team ID not found. List teams first to find the correct ID.Cannot manage access control. Check your API key permissions — admin access may be required.Collaborator with this subject and role already exists on the resource. Use a different role or remove the existing collaborator first.Invalid subject format. Use the pattern "type:identifier" — e.g., user:alice@company.com, team:platform-team, serviceaccount:ci-bot.Resource not found. Verify the resourceType and resourceId are correct. List the resources first to confirm.Built-in roles cannot be deleted. Only custom roles can be removed.