import { Check, CheckProps } from './check'; import { Frequency } from './frequency'; import { Diagnostics } from './diagnostics'; /** * Frequencies (in minutes) currently supported for agentic checks: 30, 60, 120, * 180, 360, 720 or 1440. The matching `Frequency` constants * (`EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, * `EVERY_24H`) are also accepted. */ export type AgenticCheckFrequency = 30 | 60 | 120 | 180 | 360 | 720 | 1440 | Frequency; /** * An environment variable the agent is permitted to read at runtime. * * Use the bare string form when the variable name is self-explanatory, or * the object form to provide a `description` that helps the agent understand * what the variable is for. Descriptions are passed to the model so it can * make better decisions about when to read the variable. * * @example * ```typescript * 'API_KEY' * { name: 'TOKEN_42', description: 'Feature flag service auth token' } * ``` */ export type AgentRuntimeEnvironmentVariable = string | { /** The environment variable name. */ name: string; /** * Optional human-readable explanation of what the variable is for. * Passed to the agent so it can decide when to read the variable. * Truncated to {@link MAX_ENV_VAR_DESCRIPTION_LENGTH} characters. */ description?: string; }; /** * Configures the runtime context the agent has access to during a check. * * `agentRuntime` is the explicit allowlist of resources the agent may use * at execution time. Anything not declared here is unavailable to the agent. * Treat it as a security boundary: the smaller the runtime surface, the * smaller the blast radius of any prompt injection. */ export interface AgentRuntime { /** * Additional skills to load into the agent's runtime, on top of the * defaults the runner provides automatically (currently the * `playwright-cli` skill is preloaded for browser automation). * * Each entry is passed verbatim to `npx skills add` on the runner, so * any third-party skill published to [skills.sh](https://skills.sh) * works — not just Checkly's own. Supported identifier forms: * * - A full skills.sh URL — e.g. `'https://skills.sh/microsoft/playwright-cli/playwright-cli'` * - A `/` shorthand — e.g. `'addyosmani/web-quality-skills'` * - A plain skill name registered on skills.sh — e.g. `'cost-optimization'` * * @example ['addyosmani/web-quality-skills'] */ skills?: string[]; /** * Environment variables the agent is permitted to read at runtime. * * **Variables not listed here are not exposed to the agent**, even if * they exist in the Checkly account. This is the primary defense against * prompt injection: an attacker who controls content the agent reads * cannot exfiltrate secrets the agent never had access to. * * Each entry is either a bare variable name, or an object with a * `name` and an optional `description`. Descriptions help the agent * understand what each variable is for. * * @example * ```typescript * exposeEnvironmentVariables: [ * 'API_KEY', * { name: 'TEST_USER_PASSWORD', description: 'Login password for the test account' }, * ] * ``` */ exposeEnvironmentVariables?: AgentRuntimeEnvironmentVariable[]; } /** * Configuration properties for {@link AgenticCheck}. * * Agentic checks intentionally expose only the subset of options that the * Checkly platform currently supports for them. Properties such as * `locations`, `privateLocations`, `runParallel`, `retryStrategy`, * `shouldFail`, `doubleCheck`, `triggerIncident` and `groupId` are omitted * because the platform does not yet honor them for agentic checks. They will * be added back as additive, non-breaking changes once support lands. */ export interface AgenticCheckProps extends Omit { /** * The prompt that defines what the agentic check should verify. * Maximum 10,000 characters. */ prompt: string; /** * How often the check should run. Agentic checks currently support a * restricted set of frequencies. Defaults to {@link Frequency.EVERY_30M}. * * @example * ```typescript * frequency: Frequency.EVERY_1H * // or equivalently * frequency: 60 * ``` */ frequency?: AgenticCheckFrequency; /** * Configures the runtime context the agent has access to during execution: * which skills it can use, which environment variables it can read, and * (in the future) other access surfaces such as network policies or tool * allowlists. * * Treat `agentRuntime` as a security boundary. Anything not declared here * is unavailable to the agent at runtime, which keeps the blast radius of * any prompt injection as small as possible. */ agentRuntime?: AgentRuntime; } /** * Creates an Agentic Check that uses AI to monitor websites and applications. * * Agentic checks use a prompt to define what should be verified, without * requiring traditional scripts. The AI agent interprets the prompt and * performs the checks. * * @example * ```typescript * new AgenticCheck('homepage-health', { * name: 'Homepage Health Check', * prompt: ` * Navigate to https://example.com and verify: * 1. The page loads with a 200 status * 2. The main heading is visible * 3. No console errors are present * `, * }) * ``` */ export declare class AgenticCheck extends Check { readonly prompt: string; readonly agentRuntime?: AgentRuntime; /** * Constructs the Agentic Check instance. * * @param logicalId unique project-scoped resource name identification * @param props check configuration properties */ constructor(logicalId: string, props: AgenticCheckProps); describe(): string; validate(diagnostics: Diagnostics): Promise; protected validateAgentRuntime(diagnostics: Diagnostics): Promise; synthesize(): { checkType: "AGENTIC"; prompt: string; agentRuntime: { skills: string[]; exposeEnvironmentVariables: AgentRuntimeEnvironmentVariable[]; }; activated: boolean | undefined; muted: boolean | undefined; shouldFail: boolean | undefined; locations: (keyof import("..").Region)[] | undefined; privateLocations: undefined; tags: string[] | undefined; frequency: number | undefined; frequencyOffset: number | undefined; groupId: import("./ref").Ref | null; retryStrategy: import("./retry-strategy").LinearRetryStrategy | import("./retry-strategy").ExponentialRetryStrategy | import("./retry-strategy").FixedRetryStrategy | import("./retry-strategy").SingleRetryRetryStrategy | null | undefined; doubleCheck: boolean | undefined; alertSettings: import("./alert-escalation-policy").AlertEscalation | undefined; useGlobalAlertSettings: boolean | undefined; runParallel: boolean | undefined; triggerIncident: { serviceId: import("./ref").Ref; severity: "MINOR" | "MEDIUM" | "MAJOR" | "CRITICAL"; name: string; description: string; notifySubscribers: boolean; } | undefined; description?: string | undefined; name: string; }; }