Business Hours Only Policy Template

Restrict AI agent access to LLM APIs to specific hours and days. Agents outside the allowed window receive a clear rejection — preventing overnight runaway costs and ensuring human oversight is available during all agent operations. Supports timezone-aware scheduling and per-agent overrides.

What this prevents

A data analysis agent was left running over a weekend while the engineering team was off. The agent encountered a data anomaly that caused it to retry increasingly complex queries, escalating from GPT-4o-mini to GPT-4o through fallback logic. By Monday, the agent had made 12,000 requests totaling $1,800 — with no one available to notice the alerts. A business-hours policy would have shut the agent down at 6 PM Friday, with an emergency-only agent available for truly urgent needs.

Policy template

Copy this into your govyn.yaml and adjust the values to match your requirements.

govyn.yaml
agents:
  office_agent:
    schedule:
      timezone: Europe/Lisbon
      allowed_hours:
        weekdays: "09:00-18:00"
        saturday: "10:00-14:00"
        sunday: deny
      holidays:
        - "2026-12-25"
        - "2026-01-01"
    budget:
      daily: $10.00
    on_deny:
      message: "Agent access is restricted outside business hours. Contact the team lead for emergency access."
  emergency_agent:
    schedule:
      always: allow
    budget:
      daily: $2.00
    approval:
      require_for: [all]

How it works

1

Agent sends a request to Govyn

The AI agent makes a standard LLM API call through the Govyn proxy, just as it would during normal business hours.

2

Govyn checks the current time against the schedule

The proxy looks up the agent's schedule policy, converts the current UTC time to the configured timezone (e.g. Europe/Lisbon), and checks whether the current hour falls within the allowed window.

3

Request is forwarded or denied

If the current time is within the allowed window, the request proceeds through normal policy checks (budget, model restrictions, etc.). If outside the window, the request is rejected with a configurable denial message.

4

Emergency override path

A separate emergency agent with an 'always: allow' schedule can be configured with strict approval requirements, giving your team a controlled escape valve for urgent situations.

Configuration options

Option Description Example
schedule.timezone IANA timezone for schedule evaluation Europe/Lisbon
schedule.allowed_hours.weekdays Allowed time range for Monday through Friday 09:00-18:00
schedule.holidays Specific dates to deny access (ISO 8601) 2026-12-25
on_deny.message Custom error message returned when access is denied Agent access is restricted...

Add this policy to your config

Start Govyn with this policy in under 5 minutes. No code changes needed.

Get started

Related policy templates

Explore more