Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ coverage-full: ## Full coverage without -short (live integration tests still nee
test-live: ## Run live network tests (dials external hosts, requires internet)
TEEP_LIVE_TESTS=1 go test -count=1 -race -v ./internal/tlsct/ -run TestLive

# integration-tinfoil-direct and report-tinfoil-direct are not in the aggregate targets: tinfoil_v3_direct is disabled.
integration: integration-concurrent-providers integration-tinfoil integration-neardirect integration-nearcloud integration-venice integration-chutes integration-phalacloud integration-nanogpt integration-tinfoil-fixture integration-tinfoil-direct-fixture integration-neardirect-fixture integration-nearcloud-fixture integration-venice-fixture integration-chutes-fixture ## Run all integration tests
integration: integration-concurrent-providers integration-tinfoil integration-tinfoil-direct integration-neardirect integration-nearcloud integration-venice integration-chutes integration-phalacloud integration-nanogpt integration-tinfoil-fixture integration-tinfoil-direct-fixture integration-neardirect-fixture integration-nearcloud-fixture integration-venice-fixture integration-chutes-fixture ## Run all integration tests

integration-venice: ## Run Venice integration tests (requires VENICE_API_KEY)
TEEP_TESTS_LOAD_DOTENV=1 go test -count=1 -v -race -timeout 300s -run TestIntegration_Venice ./internal/proxy/
Expand Down Expand Up @@ -111,7 +110,7 @@ test-fuzz: ## Fuzz all attestation parsers (FUZZTIME=30s by default)

check: lint test ## Run lint + test

reports: report-tinfoil report-neardirect report-nearcloud report-venice report-venice-aci report-chutes report-phalacloud report-nanogpt ## Run all attestation reports
reports: report-tinfoil report-tinfoil-direct report-neardirect report-nearcloud report-venice report-venice-aci report-chutes report-phalacloud report-nanogpt ## Run all attestation reports

report-venice: build ## Verify Venice dstack attestation (requires VENICE_API_KEY)
./teep verify venice --model e2ee-qwen3-5-122b-a10b --log-level debug --capture /tmp/teep-attestation-venice
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Yes. Teep is open source under AGPL-3.0. Dual licensing is available for commerc
| [Chutes](https://chutes.ai) | End-to-end encryption (ML-KEM-768 + ChaCha20-Poly1305) with multi-instance failover |
| [Phala Cloud](https://phala.network) | End-to-end encryption (ECDH + AES-256-GCM) to the attested private-ai-gateway |
| [Tinfoil](https://tinfoil.sh) (Cloud) | End-to-end encryption (HPKE X25519 + AES-256-GCM) via Tinfoil's model router |
| [Tinfoil](https://tinfoil.sh) (Direct) | Disabled: Tinfoil's enclave hosts do not answer attestation requests (observed 2026-11-12). Use Tinfoil (Cloud). |
| [Tinfoil](https://tinfoil.sh) (Direct) | End-to-end encryption (HPKE X25519 + AES-256-GCM) directly to per-model enclaves |

See [README_ADVANCED.md](README_ADVANCED.md) for cryptographic details.

Expand Down
2 changes: 2 additions & 0 deletions README_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ e2ee = true
[providers.tinfoil_v3_direct]
api_key_env = "TINFOIL_API_KEY"
e2ee = true
# Optional: send requests only to these enclaves of the model.
# enclaves = ["deepseek-v4-1-flash-inf16-0.tinfoil.containers.tinfoil.dev"]

[policy]
enforce = [
Expand Down
10 changes: 4 additions & 6 deletions cmd/teep/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ Environment variables:
NANOGPT_API_KEY NanoGPT API key.
PHALA_API_KEY Phala Cloud API key.
CHUTES_API_KEY Chutes API key.
TINFOIL_API_KEY Tinfoil API key (used by tinfoil_v3_cloud).
TINFOIL_API_KEY Tinfoil API key (used by tinfoil_v3_cloud and tinfoil_v3_direct).
`)
}

Expand All @@ -769,10 +769,8 @@ Usage:

The proxy activates every provider whose API key is configured (via TOML or
environment variable). Supported providers: venice, neardirect, nearcloud,
nanogpt, phalacloud, chutes, tinfoil_v3_cloud, tinfoil_v3_direct (disabled:
Tinfoil's enclave hosts do not answer attestation requests, observed
2026-11-12; use tinfoil_v3_cloud). All active providers are served
simultaneously from a single proxy instance.
nanogpt, phalacloud, chutes, tinfoil_v3_cloud, tinfoil_v3_direct. All active
providers are served simultaneously from a single proxy instance.

Clients send requests to http://127.0.0.1:8337/v1/chat/completions (or the
address set by TEEP_LISTEN_ADDR) using the same format as the OpenAI API.
Expand Down Expand Up @@ -820,7 +818,7 @@ Usage:

PROVIDER:
venice, neardirect, nearcloud, nanogpt, phalacloud, chutes,
tinfoil_v3_cloud, tinfoil_v3_direct (disabled)
tinfoil_v3_cloud, tinfoil_v3_direct

Connects to the specified provider's attestation endpoint, fetches the TEE
attestation for the given model, and runs all verification factors. The
Expand Down
5 changes: 0 additions & 5 deletions cmd/teep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/13rac1/teep/internal/attestation"
"github.com/13rac1/teep/internal/capture"
"github.com/13rac1/teep/internal/config"
"github.com/13rac1/teep/internal/provider/tinfoil"
"github.com/13rac1/teep/internal/proxy"
"github.com/13rac1/teep/internal/reqid"
"github.com/13rac1/teep/internal/verify"
Expand Down Expand Up @@ -391,10 +390,6 @@ func pruneInactiveProviders(providers map[string]*config.Provider) error {

// providerNotFoundError returns a descriptive error when a provider is not configured.
func providerNotFoundError(name string, cfg *config.Config) error {
if name == "tinfoil_v3_direct" {
// TINFOIL_API_KEY does not configure the disabled provider.
return errors.New(tinfoil.DirectDisabledMessage)
}
envVar, known := verify.ProviderEnvVar(name)
if known && len(cfg.Providers) == 0 {
return fmt.Errorf("provider %q not configured (set %s or add [providers.%s] to config)", name, envVar, name)
Expand Down
10 changes: 0 additions & 10 deletions cmd/teep/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

"github.com/13rac1/teep/internal/attestation"
"github.com/13rac1/teep/internal/config"
"github.com/13rac1/teep/internal/provider/tinfoil"
)

// buildTestReport constructs a VerificationReport with test factors.
Expand Down Expand Up @@ -144,15 +143,6 @@ func TestPruneInactiveProviders_NilProvider(t *testing.T) {
// providerNotFoundError tests
// --------------------------------------------------------------------------

// teep verify tinfoil_v3_direct names the reason the provider is disabled,
// not an API key that does not configure it.
func TestProviderNotFoundError_TinfoilDirectDisabled(t *testing.T) {
cfg := &config.Config{Providers: map[string]*config.Provider{"tinfoil_v3_cloud": {Name: "tinfoil_v3_cloud"}}}
if err := providerNotFoundError("tinfoil_v3_direct", cfg); err == nil || err.Error() != tinfoil.DirectDisabledMessage {
t.Fatalf("err = %v, want the disabled message", err)
}
}

func TestProviderNotFoundError_KnownNoConfig(t *testing.T) {
cfg := &config.Config{Providers: map[string]*config.Provider{}}
err := providerNotFoundError("venice", cfg)
Expand Down
22 changes: 22 additions & 0 deletions docs/measurement_allowlists.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ in the policy section of each provider that uses the gateway (or in the
global policy), and refreshes them when the gateway redeploys.
SEE: docs/attestation_gaps/aci_gateway.md.

`gateway_compose_hash_allow` lists the sha256 of the gateway app_compose
values the gateway may run (32 bytes of hex, not 48). When it is set,
`gateway_compose_binding` fails unless the compose binds to MRConfigID and its
hash is in the list. When it is absent, the compose is not pinned.

### Merge order

Each allowlist field is resolved independently using:
Expand Down Expand Up @@ -206,10 +211,21 @@ gateway), Tinfoil and Chutes.
| `476a2997c62bccc7...` | 2.0.08 | Granite Rapids | shared list |
| `685f891ea5c20e8f...` | 2.0.02 | Granite Rapids | shared list |
| `2d2de102461684f1...` | 2.0.18 | Granite Rapids / Clearwater Forest | shared list |
| `eddfa0c1750b39ba...` | 2.0.20 | Granite Rapids / Clearwater Forest | shared list (see below) |
| `5b38e33a6487958b...` | 1.5.06 | Sapphire/Emerald Rapids | Chutes only |
| `346bc77a1846cac2...` | 1.5.28 | Sapphire/Emerald Rapids | Chutes only |
| `ab62561a173acbd1...` | 1.5.34 | Sapphire/Emerald Rapids | Chutes only |

For 2.0.20, Intel's hash table and the release notes of `TDX_MODULE_2.0.20`
give `57a1a66f3704887a...`. The SHA-384 of the signed binary
`separate_files/2.0/2.0.20/tdx_module_2.0.20.bin` in
`intel/confidential-computing.tdx.tdx-module.binaries` (commit `73b2a66e`),
and the MRSEAM in its sigstruct at offset 900, are `eddfa0c1750b39ba...`.
The same two methods give the table's value for 2.0.08. Phala Cloud's
`deepseek/deepseek-v4.1-flash-1017` model CVM reported `eddfa0c1...` on
2026-11-19. The shared list has the value of the binary. Intel's table is
the source for the other rows.

A reasonable policy is to allow the set of non-deprecated module versions for
your target platform family. This does not require provider cooperation.

Expand Down Expand Up @@ -245,6 +261,12 @@ dstack-mr measure
| `b24d3b24e9e3c160...` | dstack-nvidia-0.5.4.1 |
| `f06dfda6dce1cf90...` | dstack-nvidia-0.5.5 |
| `df4d77c857de652b...` | dstack-nvidia-0.5.11 and 0.5.12 |
| `83baf004a06c83f6...` | dstack-0.6.3, 0.6.4 and 0.6.5 |

The dstack 0.6 value is the TDX `MRTD` that dstack publishes for each
image: `image-hashes.txt` of the `mkosi-os-v0.6.3` and `mkosi-os-v0.6.4`
releases, and the release notes of `mkosi-os-v0.6.5`, at
`github.com/Dstack-TEE/dstack/releases`.

For dstack-nvidia-0.5.12, RTMR1 and RTMR2 are not allowed until they are
computed with `mk-image-mr` from meta-dstack on the release files: no
Expand Down
41 changes: 35 additions & 6 deletions docs/providers/phalacloud/phalacloud_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,17 @@ one is not pinned:
5. The GPU evidence, verified locally with the session nonce, without NRAS:
the certificate chain and SPDM signature of every GPU must verify, as for
`nvidia_signature`.
6. For the Phala model CVM, the compose binding (MRConfigID) and the
event-log replay of RTMR0-3.
6. For the Phala model CVM, the event-log replay of RTMR0-3 and the
compose binding. An MRConfigID of version 1 (dstack 0.5) is 0x01 and
sha256(app_compose). One of version 3 (dstack 0.6) is 0x03 and the hash
of a launch document that the quote does not carry. teep builds the
document that the dstack VMM builds: compose_hash, key_provider,
key_provider_id and the init script hashes from app_compose; app_id,
instance_id and gpu_policy_hash from the RTMR3 events of the replayed
log (`attestation.VerifyComposeBindingV3`). app_compose must name
`key_provider` and give `manifest_version` as a string. dstack also
reads a compose without `key_provider` (from `kms_enabled`) or with a
numeric version; teep refuses those.

The parts of a session's evidence must have exactly the members that teep
reads. For a Chutes bundle these include the newer members of the Chutes
Expand Down Expand Up @@ -404,11 +413,30 @@ image, so a dstack-format response fails `component_recognition`.

## Factor enforcement

The report of `/v1/aci/attestation` carries no quote of the inference host;
that evidence is in the attested sessions. teep reports the factors of the
inference host from the session audit (ACI mode): a factor that the audit of
every pinned session checked passes with the detail "covered by
aci_session_verified" (`SessionAuditor.Covers`, `applyACISessionCoverage`).
These are the quote structure, certificate chain, signature and debug bit,
`tee_measurement` (the dstack or Chutes MRTD and MRSEAM list, not
`mrtd_allow`), `tee_reportdata_binding` (the session key and the gateway's
evidence nonce), the NVIDIA payload, signature and claims, online
`intel_pcs_collateral`, `tee_tcb_current` and `tee_tcb_not_revoked`, and,
when every pinned session is a Phala model CVM, `event_log_integrity` and
`compose_binding`. Every other factor keeps its own result. The audit
checks no RTMR value (`tee_hardware_config`, `tee_boot_config`), no client
nonce in the GPU evidence (`nvidia_nonce_client_bound`), no NRAS, and no
CPU-GPU binding, weights or components, so those fail.

The ACI/1 report selects `PhalaCloudACIDefaultAllowFail`: the list shared with
Venice and NanoGPT (`ACIDefaultAllowFail`) without `tls_key_binding`, which
is enforced, and with the GPU signature and nonce factors, because the
report carries no GPU evidence, and `nonce_match` and
`gateway_nonce_match`, because the report echoes no nonce.
is enforced, and without the factors that the audit checks for every session
online, which are enforced; with `nvidia_nonce_client_bound`, because the
sessions are a snapshot that the client nonce does not reach, and
`nonce_match` and `gateway_nonce_match`, because the report echoes no nonce.
`event_log_integrity` and `compose_binding` stay allowed, because the audit
does not check them for a Chutes session.
`aci_session_verified` and `aci_receipt_verified` are enforced.
`aci_receipt_verified` is a deferred skip, which does not block, when there
is no probe receipt to check: in `teep serve`, which checks the receipt of
Expand Down Expand Up @@ -501,7 +529,8 @@ stream failed.
[session tests](../../../internal/provider/aci/session_test.go), and
`TestPinSessions` and `TestPinSessionsRefuses` in
[pin tests](../../../internal/provider/aci/pin_test.go).
- `TestSessionAuditPhalaModelCVM`, `TestSessionAuditChutes` and
- `TestSessionAuditPhalaModelCVM`, `TestSessionAuditPhalaModelCVMDstack063`,
`TestComposeBindingV3Refuses`, `TestSessionAuditChutes` and
`TestSessionAuditRefuses` in
[session audit tests](../../../internal/provider/phalacloud/session_audit_test.go);
`TestFetchSessionsSelectsBoundedBundles` and `TestSelectBundles` in
Expand Down
Loading