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

# Private sessions

> Keep sessions visible only to you, and set defaults for the web UI, Slack threads, and Slack agent DMs.

Private sessions are visible only to their owner. Public sessions remain visible to everyone in your organization. Use private sessions when you're exploring sensitive code paths, drafting work you don't want to share yet, or experimenting in a personal scratch space.

## When to use private sessions

* You're working on something that isn't ready for teammates to see.
* The session involves sensitive repositories, credentials, or customer data.
* You want a personal scratch space without cluttering the shared sidebar.

For collaborative work (code reviews, pair sessions, anything you want teammates to jump into), leave the session public.

## Create a private session

### From the web UI

1. Go to **New session**.
2. Toggle **Private** before submitting.
3. Create the session.

A lock icon next to the session title indicates it's private; a globe icon indicates it's public.

### From Slack

New Slack threads and Slack agent direct messages can have different default visibility. When a Slack conversation starts a new Cake session, it uses the default for that conversation type.

You can also set visibility through the API when creating a session:

```http theme={null}
POST /api/sessions
Content-Type: application/json

{
  "title": "Investigate auth flow",
  "private": true,
  "initialUserPrompt": "Walk me through the login handshake"
}
```

The `private` field is required on session creation. Set it to `true` for a private session or `false` for a public one.

## Filter sessions in the sidebar

The sidebar can show public sessions, private sessions, or both.

* Use the visibility filter (globe and lock icons) at the top of the session list to toggle which sessions are displayed.
* Private sessions you do not own never appear in the list.

## Set default visibility

You can configure the default visibility for new sessions in **Settings → User Settings → Sessions → Privacy**. Three defaults are available:

| Setting           | Applies to                                                  | Default |
| ----------------- | ----------------------------------------------------------- | ------- |
| Web UI            | Sessions started from the **New session** screen            | Public  |
| New Slack threads | Sessions started by mentioning the bot or replying in Slack | Public  |
| Slack agent DMs   | Sessions started from the Chat tab in the Slack app         | Private |

Each setting has two scopes:

* **Organization default** (set by an admin and applied to everyone who hasn't overridden it).
* **User override** (your personal preference, which takes precedence over the org default).

Toggle the switch to flip between public and private. Use the remove control next to a setting to clear your user override and fall back to the organization default.

<Tip>
  Slack agent DMs default to private because direct messages are already a one-on-one space. You can change this if your team prefers shared visibility.
</Tip>

## How visibility is enforced

* Private sessions are filtered out of session list endpoints for users who don't own them.
* The session events stream (`GET /api/sessions/events`) skips private sessions whose owner isn't the subscriber.
* Session detail, message, and action routes return a not-found response for private sessions that don't belong to the requester.

Changing a session's owner or visibility after creation isn't supported. Pick the visibility that fits when you start the session.
