Skip to main content

Identity Security is available only with Teleport Enterprise. Start your free trial.

Start your free trial

Classify Session Recordings

Report an Issue

Session Classifiers let you define what risky activity means for your organization and monitor completed sessions for those patterns. They evaluate session summaries against built-in or custom natural-language criteria, such as data exfiltration or persistent access outside Teleport. When a session matches, a classifier can raise its risk level, flag the recording for review, or emit an audit event.

This guide walks through the built-in classifiers and shows you how to create and test a custom classifier for file permission changes.

How it works​

An inference policy is a dynamic Teleport resource that selects which completed sessions Teleport summarizes and which model generates each summary. For each successful summary, Teleport runs every enabled classifier whose session kinds and optional filters match the session.

Each classifier evaluates the summary and any available command or desktop event analysis, rather than the full session recording. Teleport saves matches with the summary, along with the model's reasoning, matched rules, and applied actions. A session can match multiple classifiers.

Classifiers use the same inference provider and model as the summary, selected by the inference policy's spec.model field. A policy that references teleport-cloud-default uses Teleport's managed model. A policy that references a custom inference model uses its configured OpenAI-compatible or Amazon Bedrock provider model. Classifiers have no separate model setting.

Classifiers match on the type of session recording summaries and any optional filters you define. The available actions for classifiers include:

ActionEffect on a match
Raise risk floorRaises the session's risk level and score to at least the selected level. It never lowers the existing risk level.
Emit audit eventEmits a classifier.matched audit event.
Flag session for reviewMarks the session summary as needing further review.

Risk floors and review flags require a structured summary. Classifiers can still record matches and emit audit events for database summaries and shell summaries that fall back to plain text.

Creating or editing a classifier applies it to new summaries. Existing summaries are not reclassified.

Classifiers analyze completed sessions. They cannot block commands or terminate active sessions.

note

A language model can miss activity or report incorrect matches. Check the match reasoning and recording when investigating a session.

Prerequisites​

  • A Teleport Enterprise cluster running v19.0.0 or later with Identity Security enabled.
  • To display classifier statistics, configure Access Graph (optional). Teleport Enterprise Cloud includes Access Graph.
  • Session Recording Summaries configured and generating summaries successfully.
  • Permission to manage classifier resources. The preset editor role grants this access. For a custom role, grant read, list, create, update, and delete on classifier.
  • Permission to view the session recordings used to verify your classifier.
  • An SSH server connected to Teleport where you can run a test session.

Step 1/3. Review the built-in classifiers​

Teleport enables these built-in classifiers by default:

Classifier (Web UI)Activity detectedRisk floor
credential-accessReading or retrieving credentials, keys, or secrets.High
data-exfiltrationMoving data out of the environment or staging it for transfer.Critical
destructive-actionsDestructive or irreversible operations.High
persistenceEstablishing persistent access outside Teleport's control.High
privilege-escalationGaining privileges during a session.High
secrets-exposed-inlineExposing secrets in plaintext session input or output.Medium
user-frustrationRepeated failures or other signs that a user or agent is stuck.Low

The built-in classifiers apply to SSH, Kubernetes, and database sessions. persistence applies only to SSH and Kubernetes sessions.

All except user-frustration also emit audit events and flag sessions for review. Risk and review actions require structured summaries, as described above.

The Web UI hides the teleport- prefix in built-in resource names. For example, credential-access in the UI is teleport-credential-access in tctl.

In the Teleport Web UI, navigate to Audit > Session Recordings. Click Manage on the Session Summaries status in the page header, then select Classifiers under Summarization & AI. The page lists built-in and custom classifiers.

Select a classifier to see its criteria and actions. Click Disable to stop evaluating it, or Enable to turn it back on.

To change a built-in classifier's criteria or actions, click Duplicate and edit the copy under a new name. If the original is enabled, the form lets you disable it when you save the copy. Keep that option selected if the copy should replace the original. If both are enabled, a session can match both.

Step 2/3. Create a custom classifier​

You can create a custom classifier to find activity that matters to your organization. As an example, create file-permission-changes to detect chmod commands in SSH sessions. It emits an audit event and flags matching sessions for review. These criteria also match harmless permission changes.

  1. On the Classifiers page, click Add Classifier.

  2. Under Details, enter file-permission-changes as the Name and a description such as Identify chmod commands in SSH sessions. Names starting with teleport- are reserved for built-in classifiers.

  3. Under Sessions, select SSH. Leave Filter expression empty to evaluate all summarized SSH sessions.

  4. Under Criteria, enter:

    Flag sessions where the user changes file or directory permissions using
    chmod. Match numeric and symbolic permission changes. Do not match commands
    that only inspect permissions, such as ls -l or stat.
    
  5. Under Actions on every match, leave Raise risk floor set to Unchanged, and enable Emit audit event and Flag session for review.

  6. Click Save classifier.

After saving the classifier, find it on the Classifiers page. It starts evaluating matching sessions.

Narrow the sessions evaluated​

A classifier's filter expression selects sessions by resource, user, or session metadata, using the same predicate language and matching context as an inference policy. For example, the following filter selects resources with the label env: prod:

equals(resource.metadata.labels["env"], "prod")

In YAML, set this expression in spec.filter. The filter selects sessions to evaluate. The natural-language criteria describe the activity to look for.

Add actions for a subset of matches​

Use a sub-rule to add actions for some matches. For example, flag all file permission changes for review, then raise the risk floor to High for changes on production resources.

In the creation form, click Add rule, name it production, set its Filter expression to equals(resource.metadata.labels["env"], "prod"), and set Raise risk floor to High. Leave Additional criteria empty to apply the rule to every classifier match on those resources. To add this rule to an existing custom classifier, open it and click Edit.

A sub-rule applies when the main classifier matches and the rule's filter and any additional criteria also match. Rule names must be unique within a classifier.

Actions from the main classifier and all matching rules apply together. The highest risk floor wins. An audit or review action stays enabled if any matching rule or the main classifier enables it. Rules cannot undo actions, and their order does not affect the result.

Step 3/3. Verify a classifier match​

Start a new SSH session after saving the classifier. Replace login with your SSH login and server with the name of a connected server:

tsh ssh login@server

In the remote shell, create a test directory, change its permissions, and remove it. The && operators stop the command if creating the directory fails:

mkdir classifier-test && chmod 700 classifier-test && rmdir classifier-test
exit

Wait for Teleport to generate the session summary, then open it from Audit > Session Recordings. Under Matched Classifiers, select file-permission-changes to inspect Why it matched, any Matched rules, and Applied actions. Check that the match shows Audit event emitted. For a structured summary, it should also show Flagged for review. If you added the production rule and the server has the label env: prod, check that the risk level is at least High.

To inspect the classifier.matched event, open Audit > Audit Log.

Checkpoint: The test session matches your classifier

If no match appears, check that the classifier is enabled and its session kinds and filter match the test session. Make sure Teleport generated the summary after you saved the classifier and that the summary describes the permission change.

If the summary shows Classification incomplete, check the error details and inference provider configuration. If risk or review actions are missing, check whether the session has a plain-text summary.

You can reach out to our Slack community or customer support for help.

Audit events​

When Emit audit event is enabled, each matching classifier emits a classifier.matched event after Teleport saves the summary. For example, these fields show a match by the built-in teleport-secrets-exposed-inline classifier:

{
  "classifier_name": "teleport-secrets-exposed-inline",
  "cluster_name": "teleport.example.com",
  "code": "INF017I",
  "event": "classifier.matched",
  "login": "ubuntu",
  "matched_command_count": 3,
  "risk_level_after": "medium",
  "session_type": "ssh",
  "sid": "11111111-2222-4333-8444-555555555555",
  "time": "2026-10-27T05:24:31.94467207Z",
  "user": "alice",
  "user_cluster_name": "teleport.example.com"
}
FieldMeaning
classifier_nameFull resource name of the classifier that matched.
sidSession ID used to find the recording.
matched_command_countNumber of analyzed commands that triggered the match. Omitted when zero, including for plain-text summaries.
risk_level_afterRisk level attributed to this classifier's match. Omitted when no risk level is assigned.
matched_rulesNames of sub-rules that applied. Omitted when no sub-rules matched.

Another matching classifier can raise the session's final risk level above the risk_level_after reported by this event.

See the AI and inference audit event reference for classifier match and configuration events.

Next steps​