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

# Overview

> Protect AI applications and agents at the points where they receive input, call tools, and produce output.

export const sdkVersions = {
  "typescript": {
    "label": "TypeScript",
    "version": "0.7.1",
    "packageName": "@silmaril-security/sdk",
    "installTarget": "@silmaril-security/sdk@0.7.1"
  },
  "python": {
    "label": "Python",
    "version": "0.7.1",
    "packageName": "silmaril-security-sdk",
    "installTarget": "silmaril-security-sdk==0.7.1"
  },
  "go": {
    "label": "Go",
    "version": "0.7.1",
    "packageName": "github.com/Silmaril-Security/sdk-go/firewall",
    "installTarget": "github.com/Silmaril-Security/sdk-go/firewall@v0.7.1"
  },
  "java": {
    "label": "Java",
    "version": "0.7.0",
    "packageName": "com.silmaril.security:silmaril-security-sdk",
    "installTarget": "com.silmaril.security:silmaril-security-sdk:0.7.0"
  }
};

<div className="docs-overview">
  <div className="docs-overview-intro">
    <h1>Silmaril</h1>
    <p>Protect long-horizon agents. Install an SDK, initialize Firewall, and classify key execution boundaries. Explore the <a href="/docs/concepts/intent-and-outcomes">core concepts</a>.</p>
  </div>

  <h2>Choose your path</h2>

  <div className="docs-home-paths">
    <a className="docs-home-path" href="/docs/start/quickstart">
      <span className="docs-tile-art docs-tile-art-firewall" aria-hidden="true">
        <span className="docs-preview-code">
          <span><span className="docs-code-keyword">await</span> <span className="docs-code-variable">fw</span>.<span className="docs-code-function">classify</span>(<span className="docs-code-variable">userInput</span>, {'{'}</span>
          <span><span className="docs-code-variable">{'  '}hook: HookLabel</span>.<span className="docs-code-constant">USER\_INPUT</span>,</span>

          <span>
            {'})'}
          </span>
        </span>
      </span>

      <span className="docs-home-path-title">Protect an AI application <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6" /></svg></span>
      <span className="docs-home-path-description">Add a language SDK and classify your first request at the model or tool boundary.</span>
    </a>

    <a className="docs-home-path" href="/docs/macos">
      <span className="docs-tile-art docs-tile-art-macos" aria-hidden="true">
        <span className="docs-macos-art">
          <img className="docs-macos-app" src="https://mintcdn.com/silmarilsecurity/-o1oGeQ7clCTZkbl/assets/silmaril-macos-icon.png?fit=max&auto=format&n=-o1oGeQ7clCTZkbl&q=85&s=55b7c6dbca698ec123c3b881e958ba51" alt="" width="112" height="112" data-path="assets/silmaril-macos-icon.png" />

          <span className="docs-macos-connection" />

          <span className="docs-macos-agents">
            <img src="https://mintcdn.com/silmarilsecurity/-o1oGeQ7clCTZkbl/assets/codex.png?fit=max&auto=format&n=-o1oGeQ7clCTZkbl&q=85&s=c4499387c6df9136b8c0ca05862b833c" alt="" width="36" height="36" data-path="assets/codex.png" />

            <img src="https://mintcdn.com/silmarilsecurity/-o1oGeQ7clCTZkbl/assets/claude.png?fit=max&auto=format&n=-o1oGeQ7clCTZkbl&q=85&s=0eeac8880ecbad80851d1dd2874e6233" alt="" width="36" height="36" data-path="assets/claude.png" />

            <img src="https://mintcdn.com/silmarilsecurity/-o1oGeQ7clCTZkbl/assets/openclaw.png?fit=max&auto=format&n=-o1oGeQ7clCTZkbl&q=85&s=3b1b9de372c49fe3dceeb0721a45aa4a" alt="" width="36" height="36" data-path="assets/openclaw.png" />
          </span>
        </span>
      </span>

      <span className="docs-home-path-title">Deploy on macOS <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6" /></svg></span>
      <span className="docs-home-path-description">Protect local coding agents with a direct install or a managed rollout through your MDM.</span>
    </a>

    <a className="docs-home-path" href="/docs/gateways/overview">
      <span className="docs-tile-art docs-gateway-art" aria-hidden="true">
        <span className="docs-gateway-mark"><img src="https://mintcdn.com/silmarilsecurity/-o1oGeQ7clCTZkbl/assets/litellm.svg?fit=max&auto=format&n=-o1oGeQ7clCTZkbl&q=85&s=e6c0a1df964e993562c6ed42abc3db02" alt="" width="44" height="44" data-path="assets/litellm.svg" /><span>LiteLLM</span></span>
        <span className="docs-gateway-mark"><img className="docs-vercel-mark" src="https://mintcdn.com/silmarilsecurity/-o1oGeQ7clCTZkbl/assets/vercel.svg?fit=max&auto=format&n=-o1oGeQ7clCTZkbl&q=85&s=d9011f21f5baf8066ed6c4c849d0c1de" alt="" width="44" height="44" data-path="assets/vercel.svg" /><span>Vercel AI Gateway</span></span>
      </span>

      <span className="docs-home-path-title">Secure an AI gateway <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6" /></svg></span>
      <span className="docs-home-path-description">Inspect model traffic through LiteLLM guardrails or Vercel AI Gateway middleware.</span>
    </a>
  </div>

  <div className="docs-example-panel">
    <h2>Classify a request</h2>

    <div className="docs-usecase-tabs">
      <Tabs>
        <Tab title="User input">
          <CodeGroup>
            ```typescript TypeScript theme={"theme":"github-light-default"}
            import { Firewall, HookLabel } from "@silmaril-security/sdk"

            const fw = new Firewall({
              apiKey: process.env.SILMARIL_API_KEY!,
              apiUrl: process.env.SILMARIL_API_URL!,
            })
            const userInput = "Summarize this release note."
            const result = await fw.classify(userInput, {
              hook: HookLabel.USER_INPUT,
            })
            console.log(result.prediction)
            ```

            ```python Python theme={"theme":"github-light-default"}
            import os
            from silmaril_security.sdk import Firewall, HookLabel

            fw = Firewall(
                api_key=os.environ["SILMARIL_API_KEY"],
                api_url=os.environ["SILMARIL_API_URL"],
            )
            user_input = "Summarize this release note."
            result = fw.classify(
                user_input, hook=HookLabel.USER_INPUT,
            )
            print(result.prediction)
            ```

            ```go Go theme={"theme":"github-light-default"}
            package main

            import (
                "context"
                "log"
                "os"
                "github.com/Silmaril-Security/sdk-go/firewall"
            )

            func main() {
                fw, err := firewall.New(firewall.Options{
                    APIKey: os.Getenv("SILMARIL_API_KEY"),
                    APIURL: os.Getenv("SILMARIL_API_URL"),
                })
                if err != nil { log.Fatal(err) }

                result, err := fw.Classify(context.Background(),
                    "Summarize this release note.",
                    firewall.WithHook(firewall.HookUserInput),
                )
                if err != nil { log.Fatal(err) }
                log.Println(result.Prediction)
            }
            ```

            ```java Java theme={"theme":"github-light-default"}
            import dev.silmaril.security.Firewall;
            import dev.silmaril.security.HookLabel;
            import dev.silmaril.security.ClassifyOptions;

            public class Example {
                public static void main(String[] args) throws Exception {
                    var fw = Firewall.builder()
                        .apiKey(System.getenv("SILMARIL_API_KEY"))
                        .apiUrl(System.getenv("SILMARIL_API_URL"))
                        .build();

                    var result = fw.classify(
                        "Summarize this release note.",
                        ClassifyOptions.builder()
                            .hook(HookLabel.USER_INPUT)
                            .build()
                    );
                    System.out.println(result.prediction());
                }
            }
            ```
          </CodeGroup>
        </Tab>

        <Tab title="Tool output">
          <CodeGroup>
            ```typescript TypeScript theme={"theme":"github-light-default"}
            import { Firewall, HookLabel } from "@silmaril-security/sdk"

            const fw = new Firewall({
              apiKey: process.env.SILMARIL_API_KEY!,
              apiUrl: process.env.SILMARIL_API_URL!,
            })
            const toolOutput = "Release note text."
            const result = await fw.classify(toolOutput, {
              hook: HookLabel.TOOL_RESPONSE,
              toolName: "read_file",
            })
            console.log(result.prediction)
            ```

            ```python Python theme={"theme":"github-light-default"}
            import os
            from silmaril_security.sdk import Firewall, HookLabel

            fw = Firewall(
                api_key=os.environ["SILMARIL_API_KEY"],
                api_url=os.environ["SILMARIL_API_URL"],
            )
            tool_output = "Release note text."
            result = fw.classify(
                tool_output, hook=HookLabel.TOOL_RESPONSE,
                tool_name="read_file",
            )
            print(result.prediction)
            ```

            ```go Go theme={"theme":"github-light-default"}
            package main

            import (
                "context"
                "log"
                "os"
                "github.com/Silmaril-Security/sdk-go/firewall"
            )

            func main() {
                fw, err := firewall.New(firewall.Options{
                    APIKey: os.Getenv("SILMARIL_API_KEY"),
                    APIURL: os.Getenv("SILMARIL_API_URL"),
                })
                if err != nil { log.Fatal(err) }

                result, err := fw.Classify(context.Background(),
                    "Release note text.",
                    firewall.WithHook(firewall.HookToolResponse),
                    firewall.WithToolName("read_file"),
                )
                if err != nil { log.Fatal(err) }
                log.Println(result.Prediction)
            }
            ```

            ```java Java theme={"theme":"github-light-default"}
            import dev.silmaril.security.Firewall;
            import dev.silmaril.security.HookLabel;
            import dev.silmaril.security.ClassifyOptions;

            public class Example {
                public static void main(String[] args) throws Exception {
                    var fw = Firewall.builder()
                        .apiKey(System.getenv("SILMARIL_API_KEY"))
                        .apiUrl(System.getenv("SILMARIL_API_URL"))
                        .build();

                    var result = fw.classify(
                        "Release note text.",
                        ClassifyOptions.builder()
                            .hook(HookLabel.TOOL_RESPONSE)
                            .toolName("read_file")
                            .build()
                    );
                    System.out.println(result.prediction());
                }
            }
            ```
          </CodeGroup>
        </Tab>

        <Tab title="Model output">
          <CodeGroup>
            ```typescript TypeScript theme={"theme":"github-light-default"}
            import { Firewall, HookLabel } from "@silmaril-security/sdk"

            const fw = new Firewall({
              apiKey: process.env.SILMARIL_API_KEY!,
              apiUrl: process.env.SILMARIL_API_URL!,
            })
            const modelOutput = "The release improves request handling."
            const result = await fw.classify(modelOutput, {
              hook: HookLabel.LLM_OUTPUT,
            })
            console.log(result.prediction)
            ```

            ```python Python theme={"theme":"github-light-default"}
            import os
            from silmaril_security.sdk import Firewall, HookLabel

            fw = Firewall(
                api_key=os.environ["SILMARIL_API_KEY"],
                api_url=os.environ["SILMARIL_API_URL"],
            )
            model_output = "The release improves request handling."
            result = fw.classify(
                model_output, hook=HookLabel.LLM_OUTPUT,
            )
            print(result.prediction)
            ```

            ```go Go theme={"theme":"github-light-default"}
            package main

            import (
                "context"
                "log"
                "os"
                "github.com/Silmaril-Security/sdk-go/firewall"
            )

            func main() {
                fw, err := firewall.New(firewall.Options{
                    APIKey: os.Getenv("SILMARIL_API_KEY"),
                    APIURL: os.Getenv("SILMARIL_API_URL"),
                })
                if err != nil { log.Fatal(err) }

                result, err := fw.Classify(context.Background(),
                    "The release improves request handling.",
                    firewall.WithHook(firewall.HookLLMOutput),
                )
                if err != nil { log.Fatal(err) }
                log.Println(result.Prediction)
            }
            ```

            ```java Java theme={"theme":"github-light-default"}
            import dev.silmaril.security.Firewall;
            import dev.silmaril.security.HookLabel;
            import dev.silmaril.security.ClassifyOptions;

            public class Example {
                public static void main(String[] args) throws Exception {
                    var fw = Firewall.builder()
                        .apiKey(System.getenv("SILMARIL_API_KEY"))
                        .apiUrl(System.getenv("SILMARIL_API_URL"))
                        .build();

                    var result = fw.classify(
                        "The release improves request handling.",
                        ClassifyOptions.builder()
                            .hook(HookLabel.LLM_OUTPUT)
                            .build()
                    );
                    System.out.println(result.prediction());
                }
            }
            ```
          </CodeGroup>
        </Tab>
      </Tabs>
    </div>

    <p className="docs-example-access"><a href="/docs/start/quickstart">Install and configure your SDK</a>, then try a classification. <a href="/docs/sdk/outcomes">Handle the result</a> before continuing.</p>
  </div>

  <h2>Language SDKs</h2>

  <div className="docs-original">
    <div className="docs-tech-stack">
      <div className="docs-tech-grid">
        <a className="docs-tech-choice" href="/docs/sdk/typescript#install">
          <div className="docs-tech-logo">
            <span className="docs-tech-logo-mark" style={{ color: "var(--competitor-blue)", borderColor: "color-mix(in srgb, var(--competitor-blue) 33%, transparent)" }} aria-hidden="true">TS</span>
            <span><span className="docs-tech-logo-name">TypeScript</span><span className="docs-tech-logo-detail">SDK {sdkVersions.typescript.version}</span></span>
          </div>
        </a>

        <a className="docs-tech-choice" href="/docs/sdk/python#install">
          <div className="docs-tech-logo">
            <span className="docs-tech-logo-mark" style={{ color: "var(--accent-warm)", borderColor: "color-mix(in srgb, var(--accent-warm) 33%, transparent)" }} aria-hidden="true">PY</span>
            <span><span className="docs-tech-logo-name">Python</span><span className="docs-tech-logo-detail">SDK {sdkVersions.python.version}</span></span>
          </div>
        </a>

        <a className="docs-tech-choice" href="/docs/sdk/go#install">
          <div className="docs-tech-logo">
            <span className="docs-tech-logo-mark" style={{ color: "var(--cyber-teal)", borderColor: "color-mix(in srgb, var(--cyber-teal) 33%, transparent)" }} aria-hidden="true">GO</span>
            <span><span className="docs-tech-logo-name">Go</span><span className="docs-tech-logo-detail">SDK {sdkVersions.go.version}</span></span>
          </div>
        </a>

        <a className="docs-tech-choice" href="/docs/sdk/java#install">
          <div className="docs-tech-logo">
            <span className="docs-tech-logo-mark" style={{ color: "var(--cyber-rose)", borderColor: "color-mix(in srgb, var(--cyber-rose) 33%, transparent)" }} aria-hidden="true">JV</span>
            <span><span className="docs-tech-logo-name">Java</span><span className="docs-tech-logo-detail">SDK {sdkVersions.java.version}</span></span>
          </div>
        </a>
      </div>
    </div>
  </div>

  <h2>Connect your stack</h2>

  <div className="docs-home-routes">
    <a href="/docs/integrations/frameworks"><span><span className="docs-route-title">Framework SDKs</span><span className="docs-route-description">Add protection to Vercel AI SDK, LangChain, or LangGraph.</span></span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6" /></svg></a>
    <a href="/docs/integrations/agent-plugins"><span><span className="docs-route-title">Coding agent plugins</span><span className="docs-route-description">Connect protection directly to supported agent hooks.</span></span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6" /></svg></a>
    <a href="/docs/integrations/firewall-mcp"><span><span className="docs-route-title">Firewall MCP</span><span className="docs-route-description">Let your MCP client investigate findings and traffic.</span></span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6" /></svg></a>
    <a href="/docs/deployment/self-hosting"><span><span className="docs-route-title">Self-hosting</span><span className="docs-route-description">Plan a deployment in your cloud account with Silmaril.</span></span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6" /></svg></a>
  </div>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.