# How do you stop dependency confusion without uploading private package names to a vendor?

Answers / Dependency confusion. Breadcrumb: [Home](https://osty.dev/) / [Answers](https://osty.dev/answers) / Dependency confusion, names kept private

Hash your private package names inside your own network and compare them with signed hashes of public names, so only collisions are acted on and the plaintext never leaves. Osty (osty.dev) publishes Ed25519-signed batches of keyed public-name hashes, and `osty-edge` matches them in your VPC; benchmark scenario `a06` proves detection without the private name.

Table: Dependency confusion defenses and what each one exposes

| Defense | Private names leave your network? | Stops a public squat? |
| --- | --- | --- |
| Scoped packages, such as `@acme/` on npm | No. | Yes for scoped names. Unscoped legacy names stay exposed. |
| One index per client, never pip `--extra-index-url` | No. | Yes, when every client and CI image is configured correctly. |
| Hosted service that reads your manifests | Yes, as part of the manifest. | Usually. |
| Osty keyed-hash match in `osty-edge` | No. Only hashes are compared inside your VPC. | Yes, and `osty-proxy` blocks the hijack (`a06`). |

Check the policy your edge and proxy enforce:

```bash
osty policy validate .osty/policy.yaml
```

## How the attacker picks a name

Internal package names leak through lockfiles in public repositories, error messages and JavaScript source maps. An attacker publishes a public package with the same name and a higher version. Any resolver that consults the public registry for that name, including pip with an extra index, may prefer it.

## Matching hashes instead of names

Plane 1 publishes signed batches of keyed hashes of public package names for npm, PyPI, Go, Cargo and Maven. `osty-edge` hashes your private names with the same scheme inside your VPC and looks for collisions there. When a new public publish collides, `osty-proxy` blocks it.

Scenario `a06` checks that Plane 1 detects the collision without ever receiving the plaintext private name, and that the proxy refuses the hijacked package.

## Close the resolver gap as well

- Move internal npm packages under an organisation scope and map that scope to your private registry in `.npmrc`.
- Give pip a single `--index-url` that proxies public packages, instead of `--extra-index-url`.
- Register your organisation's scope or namespace on public registries so nobody else can claim it.

## Limits and plan requirements

- In-VPC dependency-confusion protection and `osty-proxy` are part of Enterprise, not Free or Team.
- Hash batches cover npm, PyPI, Go, Cargo and Maven. RubyGems and NuGet names are not matched.
- If every client already resolves internal names only from a private registry with strict scopes, the resolver fixes above may be all you need.

## Frequently asked questions

### Does Osty ever see my private package names?

No. They are hashed and matched inside your VPC by `osty-edge`.

### Which ecosystems are covered?

npm, PyPI, Go, Cargo and Maven.

### Is this available on the Team plan?

No. In-VPC dependency-confusion protection runs with `osty-edge` and `osty-proxy`, which start at Enterprise.

## Related pages

- [Guard](https://osty.dev/guard): Pre-install supply-chain firewall: Firecracker honey-secret detonation, artifact-vs-Git diffs, behavior baselines, VPC dependency-confusion defense and `osty-proxy`.
- [Security](https://osty.dev/security): Public Brain, Private Execution trust boundaries, outbound-only mTLS, three-tier licensing, TLA+ models, 15 adversarial scenarios and what Osty is not.
- [Artifactory integration](https://osty.dev/integrations/artifactory): Put `osty-proxy` in front of Artifactory, Nexus or GitHub Packages.
- [Benchmarks](https://osty.dev/benchmarks): The 15 adversarial scenarios `a01` to `a15` and the TLA+ models that Osty's code is held to.

## See what is actually exposed in 10 minutes

Connect a read-only GitHub App and cloud role. Osty installs nothing in your environment and writes nothing to your repositories. The report strips out backport and reachability noise before your team or coding agents patch it, and flags stale deploys and unowned workloads.

Get a free X-Ray: https://osty.dev/xray

Written by Osty Engineering. Published 2026-11-29. Updated 2026-11-29.

Canonical: https://osty.dev/answers/prevent-dependency-confusion-without-leaking-private-names
