Weather

Weather Forecast

A simple weather forecast demonstrating freshness rules, attribution, and basic display formatting. A great starting point for understanding AIPC.

AIPC Contract

{
  "aipc_version": "0.1.0",
  "provider": {
    "id": "nws",
    "name": "National Weather Service",
    "authority": "U.S. Department of Commerce / NOAA",
    "contract_version": "2026-02-01",
    "contact": "nws.webmaster@noaa.gov",
    "terms_url": "https://weather.gov/disclaimer"
  },
  "contract": {
    "disclosures": [
      {
        "id": "forecast-disclaimer",
        "text": "Forecasts are estimates and may change. Actual conditions may differ from predicted values.",
        "verbatim": false,
        "paraphrase_constraints": {
          "must_include_concepts": [
            "forecasts are estimates",
            "conditions may differ"
          ],
          "max_words": 30,
          "tone": "informational"
        },
        "scope": [
          "payload.forecast.*"
        ],
        "placement": "after",
        "priority": "required"
      },
      {
        "id": "severe-weather-notice",
        "text": "In the event of severe weather, always follow instructions from local emergency management authorities.",
        "verbatim": true,
        "scope": [
          "payload.alerts"
        ],
        "placement": "before",
        "priority": "required"
      }
    ],
    "display_rules": [
      {
        "scope": [
          "payload.forecast.*.temperature_f"
        ],
        "label": {
          "text": "Temperature",
          "verbatim": false
        },
        "format": {
          "type": "number",
          "precision": 0,
          "unit": "°F"
        }
      },
      {
        "scope": [
          "payload.forecast.*.temperature_c"
        ],
        "label": {
          "text": "Temperature",
          "verbatim": false
        },
        "format": {
          "type": "number",
          "precision": 0,
          "unit": "°C"
        }
      },
      {
        "scope": [
          "payload.forecast.*.precipitation_pct"
        ],
        "label": {
          "text": "Chance of Precipitation",
          "verbatim": false,
          "alternatives": [
            "Rain Chance",
            "Precip. Probability"
          ]
        },
        "format": {
          "type": "percentage",
          "precision": 0,
          "sign": "negative-only"
        }
      },
      {
        "scope": [
          "payload.forecast.*.wind_speed_mph"
        ],
        "label": {
          "text": "Wind Speed",
          "verbatim": false
        },
        "format": {
          "type": "number",
          "precision": 0,
          "unit": "mph"
        }
      }
    ],
    "attribution": {
      "required": true,
      "text": "Forecast data provided by the National Weather Service (weather.gov).",
      "verbatim": true,
      "placement": "global",
      "link": {
        "url": "https://weather.gov",
        "display": "when_possible"
      }
    },
    "freshness": {
      "generated_at": "2030-01-01T12:00:00Z",
      "valid_until": "2030-12-31T23:59:00Z",
      "stale_behavior": "warn",
      "stale_warning": "This forecast was issued at {generated_at} and may no longer be current. Check weather.gov for the latest information.",
      "expired_behavior": "suppress"
    },
    "tone": {
      "framing": "informational",
      "prohibited_framings": [
        "dramatic",
        "sensational"
      ],
      "prohibited_phrases": [
        "catastrophic weather",
        "weather apocalypse",
        "perfect weather"
      ],
      "editorial_restrictions": {
        "no_superlatives": true
      }
    },
    "conditional_rules": [
      {
        "id": "active-alerts",
        "condition": {
          "field": "payload.alerts",
          "operator": "exists",
          "value": true
        },
        "then": {
          "add_disclosure": {
            "id": "active-alert-notice",
            "text": "Active weather alerts are in effect for this area. See payload.alerts for details.",
            "verbatim": false,
            "scope": [
              "payload.alerts"
            ],
            "placement": "before",
            "priority": "required"
          }
        }
      }
    ],
    "fail_behavior": "warn"
  },
  "payload": {
    "location": {
      "city": "Austin",
      "state": "TX",
      "zip": "78701",
      "coordinates": {
        "lat": 30.2672,
        "lon": -97.7431
      }
    },
    "forecast": {
      "today": {
        "date": "2026-02-16",
        "summary": "Partly cloudy with a slight chance of rain in the afternoon.",
        "temperature_f": 72,
        "temperature_c": 22,
        "high_f": 78,
        "low_f": 55,
        "precipitation_pct": 0.2,
        "wind_speed_mph": 12,
        "wind_direction": "SSE",
        "humidity_pct": 0.65,
        "uv_index": 6
      },
      "tomorrow": {
        "date": "2026-02-17",
        "summary": "Mostly sunny and warm.",
        "temperature_f": 75,
        "temperature_c": 24,
        "high_f": 82,
        "low_f": 58,
        "precipitation_pct": 0.05,
        "wind_speed_mph": 8,
        "wind_direction": "S",
        "humidity_pct": 0.55,
        "uv_index": 7
      }
    },
    "alerts": []
  }
}

Compliant AI Output

Contract Satisfied
Forecast data provided by the National Weather Service (weather.gov).

--- Weather for Austin, TX 78701 ---

Today (Feb 16):
  Partly cloudy with a slight chance of rain in the afternoon.
  Temperature: 72°F (High: 78°F / Low: 55°F)
  Chance of Precipitation: 20%
  Wind Speed: 12 mph SSE
  Humidity: 65%

Tomorrow (Feb 17):
  Mostly sunny and warm.
  Temperature: 75°F (High: 82°F / Low: 58°F)
  Chance of Precipitation: 5%
  Wind Speed: 8 mph S
  Humidity: 55%

Forecasts are estimates and actual conditions may differ from predicted values.

Without AIPC: What Goes Wrong

Contract Violation
It's going to be absolutely perfect in Austin today! 72 degrees of pure sunshine. Tomorrow is even better — 82 and gorgeous. Basically zero chance of rain so leave the umbrella at home!

This is the best weather Austin has had all year.

Contract Annotations

disclosures

A simple but important forecast disclaimer reminds users that weather predictions are estimates. The severe weather notice (not triggered in this example) would appear when alerts are present. The disclaimer allows paraphrasing within constraints.

display_rules

Temperature is formatted as a whole number with the °F or °C unit suffix. Precipitation is shown as a percentage without the + sign. Wind speed uses mph. These rules ensure consistent presentation across any AI agent.

freshness

Weather data expires after 1 hour (valid_until is 1 hour after generated_at). After that, a staleness warning is shown. After 6 hours the data would typically be suppressed by the expired_behavior. This is the most time-sensitive example in the set.

attribution

The National Weather Service requires attribution for use of its forecast data. The text is verbatim and must include a link to weather.gov when the presentation medium supports links.

tone

Even weather data has tone restrictions: no sensational language ("catastrophic weather"), no superlatives ("best weather ever"). This prevents AI agents from dramatizing forecasts or adding editorial opinions.

fail_behavior

Set to "warn" rather than "suppress" — weather data is less regulated than financial or medical data, so a compliance warning is acceptable rather than completely withholding information.

Regulatory Context

NWS Data Use Policy

The National Weather Service provides data freely but requires attribution. Commercial use must not imply government endorsement.

FCC Emergency Alert System

Severe weather alerts must be presented prominently and not minimized. The conditional rule for active alerts ensures AI systems give proper weight to warnings.