> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Keep secrets and sensitive data inside your network
URL: https://metorial.com/docs/platform/guides/keep-data-in-your-network

Use a Metorial Outpost to redact, block, and log MCP traffic inside your network, choose how much message data Metorial stores, or self-host Metorial.

---

To keep sensitive data inside your network while using Metorial, run an Outpost: an open-source (Apache 2.0) proxy you deploy in your own network that connects out to Metorial, so nothing inbound is exposed. Its middleware can redact arguments, strip results, block tools, and log every MCP message to your own systems before anything reaches Metorial. Pair it with the project's **Data Retention** level (**Full**, **Intent only**, or **None**) to control what Metorial stores, or run Metorial yourself through self-hosting or on-prem hosting.

<PageIntro>
  <Learn>
    * Which controls keep which data on your side
    * How to set up an MCP proxy Outpost with redaction
    * How retention, encryption keys, and regions fit in
  </Learn>
</PageIntro>

## Choose the controls you need [#choose-the-controls-you-need]

| Goal                                                  | Control                                                                                |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------- |
| Redact or block data before it leaves your network    | Outpost with MCP proxy middleware                                                      |
| Reach internal systems without opening inbound access | Outpost                                                                                |
| Keep a copy of all MCP traffic in your own log system | Outpost loggers: Datadog, Splunk, Elasticsearch, HTTP, OpenTelemetry                   |
| Limit what Metorial stores about sessions             | Project **Data Retention** level                                                       |
| Control the keys that encrypt stored credentials      | Your own AWS KMS keys; custom encryption keys as a plan add-on                         |
| Keep data in a region                                 | EU or US regions                                                                       |
| Run everything on your infrastructure                 | [Self-hosting](/docs/platform/guides/self-host-with-docker-compose) or on-prem hosting |

## Set up an MCP proxy Outpost [#set-up-an-mcp-proxy-outpost]

{/* VERIFY: Outposts appear in settings only when the `outposts` flag is enabled for the organization (packages/navigation/src/availability.ts). Confirm which plans include them. */}

<Steps>
  <Step title="Create the Outpost">
    In organization settings, open **Outposts** and select **Create Outpost**. Enter a name and a description.
  </Step>

  <Step title="Grant it access">
    Open the Outpost and go to its **Access** tab. For each Metorial instance that should use it, select **Proxy MCP connections** (required). Select **Proxy outpost registrations** only if you plan to nest another Outpost behind this one. Select **Save Access**.
  </Step>

  <Step title="Create a credential">
    On the **Overview** tab, select **Create Credential**, give it a name and an optional expiry date, and copy the credential into a secret manager. Metorial cannot show it again, and an expired credential stops the Outpost from connecting.
  </Step>

  <Step title="Write the proxy">
    Install `@metorial/mcp-proxy` and add middleware for what should never leave your network. This example removes an `apiKey` argument from one tool before the call is forwarded:

    ```ts
    import { McpProxy, mcpMiddleware, assertToolName } from '@metorial/mcp-proxy';

    let redactApiKey = mcpMiddleware({
      handle: async (message, call) => {
        assertToolName(message, 'call_external_api');
        let { apiKey, ...rest } = message.params.arguments ?? {};
        return call({ ...message, params: { ...message.params, arguments: rest } });
      }
    });

    await McpProxy.create({
      outpostCredential: process.env.METORIAL_OUTPOST_CREDENTIAL!,
      baseUrl: 'https://mcp.example.com',
      proxy: { port: 8080 },
      middleware: [redactApiKey]
    });
    ```

    `baseUrl` is the address your clients use to reach the Outpost.
  </Step>

  <Step title="Package and deploy it">
    Build the script into a container image and deploy it on Kubernetes or another platform inside your network. The Outpost registers itself with Metorial and opens the connection outward, so it works behind a firewall or NAT.
  </Step>

  <Step title="Point clients at it">
    To make Magic MCP URLs use your Outpost's host, set it as the custom origin in the **Magic MCP URL** section of your Workforce settings. The connection path stays the same.
  </Step>
</Steps>

The [Outpost repository](https://github.com/metorial/outpost) has examples for redacting tool arguments, redacting tool results, blocking a dangerous tool, redacting prompt arguments, restricting resource access, audit logging, and combining several middlewares.

## Choose how much Metorial stores [#choose-how-much-metorial-stores]

In project settings, open **Security**, then **Data Retention**:

| Level       | What is stored                                                                                        |
| ----------- | ----------------------------------------------------------------------------------------------------- |
| Full        | Message contents and tool calls are stored in full                                                    |
| Intent only | Tool names and the operation descriptions and rationale that agents provide, but not message contents |
| None        | Message contents, tool identity, and tool calls are never stored                                      |

The level applies to sessions started after you save. Running sessions keep the level they started with, and existing logs are removed on their normal schedule. With **None**, session logs are empty and tool call analytics and Protoguard prompt scanning are not available. You can also turn off **Store tool call attachments**. Reduced retention levels depend on your plan.

## How credentials are protected [#how-credentials-are-protected]

Provider credentials are stored in Metorial Vault, encrypted, and resolved at the gateway only when a call is allowed. They are not passed to the model, the AI client, or the user. You can import your own AWS KMS keys so stored secrets are encrypted under keys you control, and every operation on a KMS-protected secret is logged. Under **Support Access** in organization settings, you grant Metorial support access for a limited time, extend or revoke it, and see a history of every grant.

## Run Metorial yourself [#run-metorial-yourself]

The Metorial Platform is open source and can be self-hosted with Docker Compose; see [Self-host Metorial with Docker Compose](/docs/platform/guides/self-host-with-docker-compose). For production deployments with strict compliance needs, Metorial offers on-prem hosting in your own cloud or data center with dedicated support and SLAs.

## FAQ [#faq]

### Does an Outpost need inbound firewall rules? [#does-an-outpost-need-inbound-firewall-rules]

No. The Outpost connects out to Metorial over a signed, authenticated channel, so it works behind a firewall or NAT with nothing inbound exposed. Your clients connect to the Outpost inside your network.

### Can we stop certain fields from ever reaching Metorial? [#can-we-stop-certain-fields-from-ever-reaching-metorial]

Yes. Outpost middleware runs before a request is forwarded, so it can remove arguments, rewrite results, or refuse a tool call entirely. A refused call is never sent to Metorial.

### Can Metorial run with zero message retention? [#can-metorial-run-with-zero-message-retention]

Yes, with the **None** retention level, on plans that include reduced retention. Sessions and connections are still recorded, but message contents, tool identity, and tool calls are not.

### Where does Metorial store data in the cloud? [#where-does-metorial-store-data-in-the-cloud]

Choose the EU or US region. For data that must never leave your perimeter, use self-hosting or on-prem hosting.

## Related pages [#related-pages]

<Cards columns="2">
  <Card title="Audit MCP tool calls" icon="file-list-3" href="/docs/platform/guides/audit-logs">
    What is logged at each retention level.
  </Card>

  <Card title="Self-host with Docker Compose" icon="server" href="/docs/platform/guides/self-host-with-docker-compose">
    Run the open-source platform yourself.
  </Card>

  <Card title="Security on metorial.com" icon="external-link" href="https://metorial.com/security">
    Encryption, isolation, and compliance.
  </Card>

  <Card title="On-prem on metorial.com" icon="external-link" href="https://metorial.com/features/on-prem">
    Run Metorial in your own cloud or data center.
  </Card>
</Cards>