/**
 * Deployment Context
 *
 * Context dimension sets policy constraints per deployment environment.
 * Different deployment contexts have different risk profiles and
 * regulatory requirements that limit maximum trust levels.
 *
 * The context ceiling is a deployment-specific policy that cannot be
 * exceeded regardless of certification or behavioral trust.
 *
 * @packageDocumentation
 */
import type { TrustScore } from '../common/types.js';
import { z } from 'zod';
/**
 * Runtime tier type (T0-T7)
 */
export type RuntimeTier = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
/**
 * Deployment Context Enum
 *
 * Defines the deployment environments with their trust policy constraints.
 * Uses 8-tier model (T0-T7).
 */
export declare enum DeploymentContext {
    /**
     * C_LOCAL: Developer machine
     * - Personal development environment
     * - No policy restrictions
     * - Maximum trust: T7 Autonomous (no limit)
     */
    C_LOCAL = "local",
    /**
     * C_TEAM: Team environment
     * - Shared team development/staging
     * - Standard security policies
     * - Maximum trust: T6 Certified
     */
    C_TEAM = "team",
    /**
     * C_ENTERPRISE: Enterprise SaaS
     * - Production enterprise deployment
     * - Corporate security policies
     * - Maximum trust: T5 Trusted
     */
    C_ENTERPRISE = "enterprise",
    /**
     * C_REGULATED: Regulated industry
     * - Financial, healthcare, etc.
     * - Strict compliance requirements
     * - Maximum trust: T4 Standard (without human approval)
     * - Requires human-in-the-loop for higher actions
     */
    C_REGULATED = "regulated",
    /**
     * C_SOVEREIGN: Government/defense
     * - Government or military deployments
     * - Highest security requirements
     * - Maximum trust: T6 Certified (with hardware attestation)
     * - Requires attestation for trusted operations
     */
    C_SOVEREIGN = "sovereign"
}
/**
 * Context ceiling configuration
 */
export interface ContextCeiling {
    /** Maximum tier allowed in this context */
    maxTier: RuntimeTier;
    /** Maximum score allowed */
    maxScore: number;
    /** Whether human approval is required for actions above base tier */
    requiresHuman?: boolean;
    /** Tier at which human approval becomes required */
    humanRequiredAboveTier?: RuntimeTier;
    /** Whether hardware attestation is required */
    requiresAttestation?: boolean;
    /** Human-readable description */
    description: string;
}
/**
 * Context policy evaluation result
 */
export interface ContextPolicyResult {
    /** Whether the action is allowed under context policy */
    allowed: boolean;
    /** Effective maximum tier after policy */
    maxTier: RuntimeTier;
    /** Maximum score after policy */
    maxScore: number;
    /** Whether human approval is needed */
    humanApprovalRequired: boolean;
    /** Whether attestation is needed */
    attestationRequired: boolean;
    /** Reason for any restrictions */
    reason?: string;
}
/**
 * Context ceiling definitions (8-tier model T0-T7)
 *
 * Maps each deployment context to its trust policy constraints.
 */
export declare const CONTEXT_CEILINGS: Record<DeploymentContext, ContextCeiling>;
/**
 * Context names for display
 */
export declare const CONTEXT_NAMES: Record<DeploymentContext, string>;
/**
 * Schema for DeploymentContext validation
 */
export declare const DeploymentContextSchema: z.ZodNativeEnum<typeof DeploymentContext>;
/**
 * Schema for context configuration
 */
export declare const ContextConfigSchema: z.ZodObject<{
    context: z.ZodNativeEnum<typeof DeploymentContext>;
    customMaxTier: z.ZodOptional<z.ZodNumber>;
    customMaxScore: z.ZodOptional<z.ZodNumber>;
    humanApprovalEnabled: z.ZodOptional<z.ZodBoolean>;
    attestationEnabled: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    context?: DeploymentContext;
    customMaxTier?: number;
    customMaxScore?: number;
    humanApprovalEnabled?: boolean;
    attestationEnabled?: boolean;
}, {
    context?: DeploymentContext;
    customMaxTier?: number;
    customMaxScore?: number;
    humanApprovalEnabled?: boolean;
    attestationEnabled?: boolean;
}>;
export type ContextConfig = z.infer<typeof ContextConfigSchema>;
/**
 * Get the trust ceiling for a deployment context
 *
 * @param context - The deployment context
 * @returns The maximum runtime tier allowed
 */
export declare function getContextCeiling(context: DeploymentContext): RuntimeTier;
/**
 * Get the maximum score for a deployment context
 *
 * @param context - The deployment context
 * @returns The maximum trust score allowed
 */
export declare function getContextMaxScore(context: DeploymentContext): number;
/**
 * Apply context ceiling to a trust score
 *
 * @param score - The trust score to check
 * @param context - The deployment context
 * @returns The score, capped at the context ceiling
 */
export declare function applyContextCeiling(score: TrustScore, context: DeploymentContext): TrustScore;
/**
 * Check if human approval is required for an action
 *
 * @param context - The deployment context
 * @param requestedTier - The trust tier being requested
 * @returns True if human approval is required
 */
export declare function requiresHumanApproval(context: DeploymentContext, requestedTier: RuntimeTier): boolean;
/**
 * Check if attestation is required for an action
 *
 * @param context - The deployment context
 * @returns True if hardware attestation is required
 */
export declare function requiresAttestation(context: DeploymentContext): boolean;
/**
 * Evaluate context policy for a requested action
 *
 * @param context - The deployment context
 * @param requestedTier - The trust tier being requested
 * @param hasHumanApproval - Whether human approval has been obtained
 * @param hasAttestation - Whether hardware attestation is present
 * @returns Policy evaluation result
 */
export declare function evaluateContextPolicy(context: DeploymentContext, requestedTier: RuntimeTier, hasHumanApproval?: boolean, hasAttestation?: boolean): ContextPolicyResult;
/**
 * Get human-readable description of context constraints
 *
 * @param context - The deployment context
 * @returns Description of the policy implications
 */
export declare function describeContextConstraints(context: DeploymentContext): string;
/**
 * Determine deployment context from environment
 *
 * Analyzes environment variables and configuration to determine
 * the appropriate deployment context.
 *
 * @returns The detected deployment context
 */
export declare function detectDeploymentContext(): DeploymentContext;
//# sourceMappingURL=context.d.ts.map