# createPolicy **Type:** GraphQL mutations **Description:** Create a new policy ## Arguments - input (CreatePolicyInput, Not Null): undefined - name (String): Policy name - trigger (PolicyTriggerInput, Not Null): Trigger configuration - type (PolicyTriggerType, Not Null): Type of trigger event - conditions (PolicyConditionGroupInput, Not Null): Condition groups - agentFilter (AgentFilter): Optional filter on agent properties - search (String) - severity (SeverityFilter) - platform (PlatformFilter) - environment (EnvironmentFilter) - accessibility (AccessibilityFilter) - owner (OwnerFilter) - tools (ToolFilter) - findings (FindingFilter) - id (StringFilter) - usage (UsageRangeFilter) - lastSession (DateRangeFilter) - foundationalModel (StringFilter) - toolFilter (ToolFilterInput): Optional filter on tool properties (for TOOL_INVOCATION trigger) - id (StringFilter) - search (String) - type (StringFilter) - enabled (BooleanFilter) - environment (EnvironmentFilter) - findings (FindingFilter) - agent (AgentFilter) - findingFilter (FindingFilter): Optional filter on findings - type (FindingTypeFilter): Filter by finding type - id (StringFilter): Filter by finding ID - detectionFilter (DetectionFilter): Optional filter on runtime detections - type (DetectionTypeFilter) - id (StringFilter) - groups (PolicyConditionGroupInput): Optional nested condition groups - actions (PolicyActionInput, Not Null): Actions to execute - type (PolicyActionType, Not Null): Type of action to execute - createIssueParams (PolicyCreateIssueActionParamsInput): Parameters for CREATE_ISSUE action (required when type is CREATE_ISSUE) - issueSeverity (PolicySeverity): Severity to assign when creating an issue - autoResolve (Boolean): Automatically resolve issues when conditions are no longer met ## Response **Type:** Policy **Description:** Represents a policy that evaluates agent events and creates issues ### Fields - id (ID): Unique identifier for the policy - name (String): Policy name - description (String): Detailed description of what the policy does - mode (PolicyMode): Current enforcement mode of the policy - status (PolicyStatus): Current status of the policy - trigger (PolicyTrigger): Event that triggers policy evaluation - conditions (PolicyConditionGroup): Conditions that must be met for the policy to match - actions (PolicyAction): Actions to execute when policy conditions match - autoResolve (Boolean): Automatically resolve issues when conditions are no longer met - isDefault (Boolean): Indicates if this policy is a system default or custom/modified by the tenant - issuesCount (Int): Number of issues created by this policy - lastExecutedAt (DateTime): When the policy was last executed - createdAt (DateTime): When the policy was created - updatedAt (DateTime): When the policy was last updated - createdBy (Owner): User who created the policy - updatedBy (Owner): User who last updated the policy - version (Int): Version number, incremented on each update - deletedAt (DateTime): When the policy was soft-deleted (null if active) - environmentTypes (EnvironmentType): Effective environment types where this policy applies. Returns specific environments if conditions include environment filters, or all environments (Prod, Sandbox, Dev) if no environment filter is specified.