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

# Loupe

> Understand the current compatibility boundary between Loupe, Claude Code, and Prem API.

[Loupe](https://loupe.build/) is a macOS application that creates AI workers with a browser, terminal, and Claude Code chat. Loupe is not a separate OpenAI- or Anthropic-compatible model client.

<Warning>
  Loupe is not currently supported as a Prem integration. Its public documentation does not expose a provider, base URL, or launch-environment setting for embedded Claude Code workers, so the worker cannot be connected to the local Confidential Proxy through a documented configuration.
</Warning>

## What Loupe adds

Loupe combines three local surfaces for each worker:

* a Claude Code chat;
* a terminal;
* a browser with Chrome DevTools MCP access.

It can pass console and terminal errors to its Claude Code worker. This makes Loupe an orchestration and user-interface layer around Claude Code, not another inference protocol.

```mermaid theme={"system"}
flowchart TB
    subgraph Loupe["Loupe on macOS"]
        W["Worker"]
        B["Browser and DevTools MCP"]
        T["Terminal"]
        C["Embedded Claude Code"]
        B --> W
        T --> W
        W --> C
    end

    C -.->|"Requires a configurable Anthropic endpoint"| P["Confidential Proxy<br/>127.0.0.1:8787/v1"]
    P -->|"Encrypted model request"| G["Prem API Gateway"]
    G --> E["Prem confidential runtime"]
```

The dotted connection is conditional. It exists only when Loupe passes Prem's Claude Code endpoint and authentication settings to the embedded process.

## Before you start

Separate two questions:

1. **Does Claude Code work through Prem?** Yes. Use the tested [Claude Code guide](/guides/claude-code).
2. **Does Loupe expose the settings needed to make its embedded Claude Code use Prem?** This is not documented by Loupe today.

A direct Loupe integration requires all of the following:

* a Loupe build that exposes the embedded Claude Code launch environment or command;
* a way to set the Anthropic base URL, authentication token, and model for that worker;
* a Prem API key and 64-character hexadecimal client KEK;
* a successful model-list request, non-streaming turn, streaming turn, and tool call;
* confirmation that the worker did not fall back to Anthropic or another provider.

## Use Claude Code through Prem today

Run Claude Code outside Loupe with Prem's launcher:

```bash theme={"system"}
export API_KEY="your-prem-api-key"
export CLIENT_KEK="your-64-character-hex-kek"
export PROXY_URL="https://gateway.prem.io"
export ENCLAVE_URL="https://conf-engine.prem.io"

npx -p @premai/api-sdk@1.0.59 confidential-claude
```

This starts the local Confidential Proxy, selects an enabled Prem model, and launches Claude Code against the Anthropic-compatible endpoint. It does not reconfigure Loupe's embedded worker.

## Validate a future Loupe integration

When Loupe exposes worker configuration, test it in this order:

1. Start the Confidential Proxy in Anthropic mode with attestation enabled.
2. Select a model returned by `/v1/models`.
3. Configure the embedded Claude Code process to use the local proxy and Prem API key.
4. Send a bounded prompt and confirm a request reaches the local proxy.
5. Confirm the response streams through the Anthropic Server-Sent Events route.
6. Run one file-reading tool call and confirm the tool executes locally.
7. Block the direct Anthropic endpoint during the test and confirm Loupe does not fall back.
8. Restart Loupe and confirm the provider configuration remains effective.

The model name shown in the Loupe interface does not prove how the request was routed. Confirm that the request reaches the local proxy and that no direct provider connection occurs.

## Security boundary

| Component                 | Plaintext access                  | Notes                                                            |
| ------------------------- | --------------------------------- | ---------------------------------------------------------------- |
| Loupe                     | Yes                               | Coordinates workers, browser state, terminals, and error context |
| Embedded Claude Code      | Yes                               | Reads prompts, files, browser context, and tool results          |
| DevTools MCP and terminal | Yes, for the data they handle     | Remain outside the Prem confidential runtime                     |
| Confidential Proxy        | Yes, locally                      | Encrypts configured model requests and decrypts responses        |
| Prem API Gateway          | No content access                 | Receives ciphertext and operational metadata                     |
| Prem confidential runtime | Yes, inside the protected runtime | Runs inference and encrypts the response                         |

Even after model routing works, Loupe's browser, terminal, DevTools MCP, worker state, and local logs remain separate security surfaces.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Loupe offers no provider or environment setting">
    The direct integration is not available through the documented product surface. Use Claude Code through `confidential-claude` outside Loupe and request an explicit worker-provider setting from Loupe.
  </Accordion>

  <Accordion title="Loupe still calls Anthropic directly">
    Stop the test. The embedded Claude Code process did not receive or retain the Prem endpoint configuration. Do not treat the session as protected by Prem.
  </Accordion>

  <Accordion title="The proxy receives no request">
    Confirm that Loupe launches the worker with the required environment. A proxy running on `127.0.0.1:8787` is not sufficient by itself.
  </Accordion>

  <Accordion title="Tools work but the model route is unclear">
    Tool execution proves only the local Loupe workflow. Confirm model traffic independently at the Confidential Proxy.
  </Accordion>
</AccordionGroup>

## Frequently asked questions

### Is Loupe a model provider?

No. Loupe describes each worker as a browser, terminal, and Claude Code chat.

### Does the Claude Code integration prove that Loupe works with Prem?

No. It proves the underlying Claude Code path. Loupe must still expose or inherit the same provider configuration for its embedded worker.

### Can Prem protect Loupe's browser or terminal traffic?

No. Prem's model path does not place browser, terminal, DevTools MCP, or local worker state inside the confidential runtime.

### What would make Loupe compatible?

A documented worker configuration surface and an end-to-end acceptance test that proves model traffic reaches the local proxy without direct-provider fallback.

## Related

<CardGroup cols={2}>
  <Card title="Claude Code" icon="terminal" href="/guides/claude-code" arrow="true">
    Use the tested Claude Code path through Prem.
  </Card>

  <Card title="Anthropic-compatible clients" icon="comments" href="/guides/anthropic-compatible-clients" arrow="true">
    Review the Messages protocol and compatibility limits.
  </Card>

  <Card title="Confidential Proxy" icon="server" href="/confidential-proxy" arrow="true">
    Review proxy modes, routes, and keys.
  </Card>

  <Card title="Security Model" icon="shield-halved" href="/security-model" arrow="true">
    Review what the confidential inference path protects.
  </Card>
</CardGroup>
