Skip to content

Commit 6d7f18d

Browse files
varunursekarclaude
andcommitted
harbor: k-anonymity floor defaults to 5, not a no-op (feedback #2)
min_aggregate_cases defaulted to 1 — a vacuous floor that let an agent read held-out validation labels one case at a time via single-case aggregate evals. Default to 5 in both the sidecar policy and the build AgentAccessSpec so a build that omits it is safe rather than unfloored (shipped builds already set 5 explicitly). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent dcd7ffa commit 6d7f18d

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

vero/src/vero/harbor/build/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class AgentAccessSpec(EvaluationModel):
2323
partition: str
2424
disclosure: DisclosureLevel = DisclosureLevel.AGGREGATE
2525
expose_case_resources: bool = False
26-
min_aggregate_cases: int = Field(default=1, ge=1)
26+
# k-anonymity floor for aggregate subset evals; 5 by default so an omitted
27+
# value is safe rather than an unfloored (single-case) leak.
28+
min_aggregate_cases: int = Field(default=5, ge=1)
2729
total_runs: int | None = Field(default=None, ge=0)
2830
total_cases: int | None = Field(default=None, ge=0)
2931

vero/src/vero/harbor/sidecar.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ class SidecarEvaluationPolicy(EvaluationModel):
7272
disclosure: DisclosureLevel = DisclosureLevel.AGGREGATE
7373
expose_case_resources: bool = False
7474
agent_evaluable: bool = True
75-
min_aggregate_cases: int = Field(default=1, ge=1)
75+
# k-anonymity floor: aggregate subset evals must cover >= this many cases so
76+
# a single held-out label can't be read off one case at a time. Default 5
77+
# (not 1) so a build that omits it is safe rather than unfloored.
78+
min_aggregate_cases: int = Field(default=5, ge=1)
7679
parameters: dict[str, JsonValue] = Field(default_factory=dict)
7780
allowed_parameters: list[str] = Field(default_factory=list)
7881
limits: EvaluationLimits | None = None

vero/tests/test_v05_harbor_build.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,3 +657,8 @@ def test_compiler_uses_published_version_outside_a_source_checkout(
657657
assert not (output / "environment/vero").exists()
658658
dockerfile = (output / "environment/Dockerfile").read_text(encoding="utf-8")
659659
assert "scale-vero[harbor]==0.5.0" in dockerfile
660+
661+
662+
def test_agent_access_defaults_to_safe_k_anonymity_floor():
663+
# Omitting min_aggregate_cases must yield a real floor (5), not a no-op (1).
664+
assert AgentAccessSpec(partition="validation").min_aggregate_cases == 5

vero/tests/test_v05_harbor_sidecar.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,3 +698,12 @@ async def run_as_different_owner(command, cwd=None, timeout=30, env=None):
698698
)
699699
== ""
700700
)
701+
702+
703+
def test_sidecar_policy_defaults_to_safe_k_anonymity_floor():
704+
from vero.harbor.sidecar import SidecarEvaluationPolicy
705+
706+
policy = SidecarEvaluationPolicy(
707+
backend_id="b", evaluation_set_name="s"
708+
)
709+
assert policy.min_aggregate_cases == 5

0 commit comments

Comments
 (0)