> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Private attributes: AI SDKs

> This topic explains how to configure private context and user attributes in LaunchDarkly SDKs. These features are available for client-side, server-side, and AI SDKs. This page covers ai sdks.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

## AI SDKs

Here are the configuration options for private context attributes in AI SDKs:

* [.NET AI](#net-ai)
* [Go AI](#go-ai)
* [Node.js (server-side) AI](#nodejs-server-side-ai)
* [Python AI](#python-ai)
* [Ruby AI](#ruby-ai)

### .NET AI

<Accordion title="Expand .NET AI SDK code sample">
  In the .NET AI SDK you can mark attributes as private when building the context object by calling `Private()` after setting the attribute on the context builder.

  For example:

  <CodeGroup>
    ```csharp title=".NET AI SDK" theme={null}
          var context = Context.Builder("example-context-key")
              .Set("email", "sandy@example.com")
              .Private("email")
              .Build();
    ```
  </CodeGroup>

  When the SDK sends this context back to LaunchDarkly, it removes the `email` attribute.
</Accordion>

### Go AI

<Accordion title="Expand Go AI SDK code sample">
  In the Go AI SDK you can mark attributes as private when building the context object by calling `Private()` after setting the attribute on the context builder.

  For example:

  <CodeGroup>
    ```go title="Go AI SDK" theme={null}
          import (
              "github.com/launchdarkly/go-sdk-common/v3/ldcontext"
          )

          context := ldcontext.NewBuilder("example-context-key").
              Kind("organization").
              Name("Global Health Services").
              SetString("email", "info@globalhealthexample.com").
              Private("email").
              Build()
    ```
  </CodeGroup>

  When the SDK sends this context back to LaunchDarkly, it removes the `email` attribute.
</Accordion>

### Node.js (server-side) AI

<Accordion title="Expand Node.js (server-side) AI SDK code sample">
  In the Node.js (server-side) AI SDK you can define a set of `privateAttributes` on the context object.

  Here's how:

  <CodeGroup>
    ```ts title="Node.js (server-side) AI SDK (TypeScript)" theme={null}
          const context: LDContext = {
            kind: 'user',
            key: 'example-user-key',
            email: 'sandy@example.com',
            privateAttributes: ['email'],
          };
    ```

    ```ts title="Node.js (server-side) AI SDK (JavaScript)" theme={null}
          const context = {
            kind: 'user',
            key: 'example-user-key',
            email: 'sandy@example.com',
            privateAttributes: ['email'],
          };
    ```
  </CodeGroup>

  When the SDK sends this context back to LaunchDarkly, it removes the `email` attribute.
</Accordion>

### Python AI

<Accordion title="Expand Python AI code sample">
  In the Python AI SDK you can mark attributes as private when building the context object by calling the `private` builder method.

  Here's how:

  <CodeGroup>
    ```python title="Python AI SDK" theme={null}
          context = Context.builder("example-context-key") \
              .set("email", "sandy@example.com") \
              .private("email") \
              .build()
    ```
  </CodeGroup>

  When the SDK sends this context back to LaunchDarkly, it removes the `email` attribute.
</Accordion>

### Ruby AI

<Accordion title="Expand Ruby AI code sample">
  In the Ruby AI SDK you can mark attributes as private when creating the context.

  Here's how:

  <CodeGroup>
    ```ruby title="Ruby AI SDK" theme={null}
          context = LaunchDarkly::LDContext.create({
              key: "example-user-key",
              kind: "user",
              firstName: "Sandy",
              lastName: "Smith",
              email: "sandy@example.com",
              groups: ["Acme", "Global Health Services"],
              _meta: {
                privateAttributes: ['email']
              }
          })
    ```
  </CodeGroup>

  When the SDK sends this context back to LaunchDarkly, it removes the `email` attribute.
</Accordion>
