vtcode_computer_use/gate.rs
1//! Verified computer-use target matrix.
2//!
3//! A (provider, model, endpoint, protocol) tuple becomes usable only after
4//! the acceptance runs in the approved plan prove it live. The matrix grows
5//! one entry per accepted probe: unknown tuples stay denied, and every
6//! denial happens before any network I/O.
7
8/// One live-verified computer-use target.
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub struct VerifiedTarget {
11 /// Provider key, e.g. `"anthropic"`.
12 pub provider: &'static str,
13 /// Exact model identifier.
14 pub model: &'static str,
15 /// Exact API endpoint the probe ran against.
16 pub endpoint: &'static str,
17 /// Native protocol version, e.g. `"computer_toolset_20260801"`.
18 pub protocol: &'static str,
19}
20
21/// Targets proven by live acceptance runs. Each entry records a probe that
22/// returned `computer_call` for the exact tuple; unknown tuples stay denied.
23pub const VERIFIED_MATRIX: &[VerifiedTarget] = &[
24 // Accepted 2026-11-19 by scripts/probe_openai_computer_use.py: P1
25 // declared tools=[{type:computer}] and received computer_call with a
26 // screenshot action; P2 replayed a real container screenshot
27 // statelessly (store=false, no previous_response_id) and the route
28 // continued with reasoning + computer_call. ~3k tokens on gpt-6-luna.
29 VerifiedTarget {
30 provider: "openai",
31 model: "gpt-6-luna",
32 endpoint: "https://api.openai.com/v1",
33 protocol: "computer",
34 },
35];
36
37/// Whether `matrix` admits an exact target match.
38#[must_use]
39pub fn verified_target(matrix: &[VerifiedTarget], provider: &str, model: &str, endpoint: &str, protocol: &str) -> bool {
40 matrix.iter().any(|target| {
41 target.provider == provider
42 && target.model == model
43 && target.endpoint == endpoint
44 && target.protocol == protocol
45 })
46}
47
48/// Whether [`VERIFIED_MATRIX`] admits the target.
49#[must_use]
50pub fn verified_target_default(provider: &str, model: &str, endpoint: &str, protocol: &str) -> bool {
51 verified_target(VERIFIED_MATRIX, provider, model, endpoint, protocol)
52}
53
54#[cfg(test)]
55mod tests;