Skip to main content
Tags are custom key-value pairs you attach to Kosli resources. They let you categorize, filter, and add metadata to your flows, environments, controls, and repositories without changing the resources themselves.

Why use tags

  • Organize resources — group related resources by team, project, region, or any other dimension.
  • Drive policy behavior — reference tags in Environment Policy expressions to make attestation requirements conditional. For example, require security scans only for flows tagged risk-level=high.
  • Add operational metadata — store context such as cost center, service tier, or owner directly on the resource.

Supported resources

You can tag the following Kosli resource types:

Tag key and value rules

  • Keys must start with a letter or digit and can contain letters, digits, hyphens (-), underscores (_), dots (.), and tildes (~).
  • Values are strings. If a value is a valid URL (e.g. https://example.com), Kosli automatically renders it as a clickable link in the UI.
  • There is no fixed limit on the number of tags per resource, but keep them concise for readability.

Add or update tags

Add a tags map to any kosli_environment, kosli_flow, or kosli_control resource. Tags are applied via a diff — only changed tags are sent to the API.Tag an environment:
Tag a flow:
Tag a repo with a kosli_repo_tags resource. Kosli records repos itself, so look up the repo’s internal ID with the kosli_repo or kosli_repos data source:
kosli_repo_tags manages every tag on the repo, so Terraform removes tags added outside it, in the UI or with kosli tag repo, on the next apply.See the kosli_environment resource, kosli_flow resource and kosli_repo_tags resource for the full schema.

Remove tags

Remove individual tags by deleting them from the tags map. Set tags = {} to remove all tags:
For a repo, set tags = {} on its kosli_repo_tags resource. Destroying a kosli_repo_tags resource also removes every tag on the repo.

Read tags

Use data sources to read tags from existing resources:
The kosli_repo data source returns a repo’s tags the same way. The kosli_repos data source returns tags on each entry of its repos list.
A consistent tagging strategy makes it easier to organize resources as your Kosli usage grows. Here are common patterns:
Pick a small set of tag keys and document them for your organization. Consistent keys across environments and flows make filtering and policy expressions predictable.

Example: categorizing environments by stage

Tag your environments to reflect their deployment stage. This lets you quickly identify which environments are production-critical and apply policies accordingly:

Using tags in policies

Tags become powerful when combined with Environment Policies. You can reference flow tags in policy expressions to conditionally require attestations:
In this example, the security-scan attestation is only required when the flow is tagged with risk-level=high. This lets you enforce stricter compliance for high-risk services while keeping lighter requirements for lower-risk ones. For the full expression syntax, see the Environment Policy reference.
Last modified on November 16, 2026