---
title: "Analyze rule-set interactions and configuration impact"
method: POST
path: "/v1/programs/{program_id}/rule-configuration/analysis"
tags: ["Rules"]
---

# Analyze rule-set interactions and configuration impact

`POST /v1/programs/{program_id}/rule-configuration/analysis`

## Request

- Base URL: `https://api.scrip.dev`
- URL: `https://api.scrip.dev/v1/programs/{program_id}/rule-configuration/analysis`
- Auth: HTTP bearer

Check the current or proposed rule configuration for potential interactions between rules.

## Path parameters

- `program_id` string, uuid, required

## Request body

- AnalyzeRuleConfigurationRequest: Asks Scrip to check a program's rule configuration for problems. Omit `proposed_configuration` to check the live configuration. Nothing is saved.
  - `focus` RuleConfigurationAnalysisFocusRequest: Limits an analysis to findings that involve the rule sets or rules you name.
    - `client_refs` string[]: Proposed client_ref values for new rule sets or rules to focus.
    - `rule_ids` string[]: Existing rule UUIDs to focus.
    - `rule_set_ids` string[]: Existing rule-set UUIDs to focus.
  - `proposed_configuration` PreviewRuleConfigurationRequest (unresolved $ref)

## Response `200`

The findings for the analyzed configuration

- AnalyzeRuleConfigurationResponse: The problems Scrip found in a rule configuration, each with a severity and a suggested fix.
  - `active_rule_count` integer: ACTIVE rules participating in runtime interaction analysis.
  - `base_rule_configuration_version` integer: Current configuration version used as the basis for the analysis.
  - `configuration_hash` string: Stable SHA-256 hash of the analyzed current configuration or normalized proposal.
  - `finding_count` integer: Number of findings returned.
  - `findings` RuleConfigurationFinding[]: Potential issues and suggested fixes, in a stable order.
    - `code` string: The kind of problem, such as `duplicate_reward_effect` or `unconditional_stop_shadows_following_rules`.
    - `confidence` 'certain' | 'likely' | 'advisory': How sure Scrip is that this is a real problem.
    - `message` string: What Scrip found, in a sentence.
    - `paths` RuleConfigurationFindingPath[]: The places in the rules that the finding points to.
      - `client_ref` string: The `client_ref` of the rule, when the rule is new.
      - `path` string: The place in the rule, such as `condition` or `actions[0].amount`.
      - `rule_id` string: The rule the finding points to.
    - `remediation` string: How to fix the problem.
    - `rule_sets` RuleConfigurationFindingRuleSet[]: The rule sets involved.
      - `client_ref` string: The `client_ref` of the rule set, when the rule set is new.
      - `id` string: The id of the rule set that the finding involves.
      - `key` string: The key that identifies the rule set within the program.
      - `order` integer: The rule set's position in the program.
    - `rules` RuleConfigurationFindingRule[]: The rules involved.
      - `client_ref` string: The `client_ref` of the rule, when the rule is new.
      - `id` string: The id of the rule that the finding involves.
      - `name` string: The name people see for the rule.
      - `order` integer: The rule's position in its rule set.
      - `rule_set_client_ref` string: The `client_ref` of the rule set, when the rule set is new.
      - `rule_set_id` string: The id of the rule set that holds the rule.
      - `rule_set_order` integer: The rule set's position in the program.
    - `runtime_semantics` string: How Scrip behaves at run time for this configuration.
    - `severity` 'warning' | 'info': How serious the problem is.
  - `grounding` RuleConfigurationAnalysisGrounding: Which checks an analysis ran on event fields.
    - `observed_event_shapes_analyzed` boolean: Whether the analysis compared rule references with fields seen in recent events. This endpoint returns false.
    - `static_event_references_analyzed` boolean: Whether the analysis checked event field references in rule expressions.
  - `limits` RuleConfigurationAnalysisLimits: The size limits Scrip applies to a rule configuration analysis.
    - `max_comparisons` integer: The most pairs of rules Scrip compares.
    - `max_effects` integer: The most rule actions Scrip compares.
    - `max_findings` integer: The most findings Scrip returns.
    - `max_rules` integer: The most rules Scrip analyzes at once.
  - `program_id` string, uuid: Program whose configuration was analyzed.
  - `rule_count` integer: Total ACTIVE and SUSPENDED rules in the analyzed configuration.
  - `source` 'current' | 'proposed': Configuration source: current or proposed.
  - `truncated` boolean: True when the response limit prevented some findings from being returned.

## Other responses

- `400`: The body or the proposed configuration is malformed (code: validation_error | invalid_json)
- `401`: The API key is missing or not valid. See [Authentication](https://docs.scrip.dev/authentication).
- `403`: The caller is not allowed to do this.
- `404`: Program not found (code: program_not_found)
- `409`: The proposed configuration's base_rule_configuration_version is behind the live version (code: rule_configuration_version_conflict)
- `422`: The configuration is too large to analyze, or focus names a rule or rule set it does not have (code: rule_configuration_analysis_limit_exceeded | rule_configuration_analysis_complexity_exceeded | invalid_rule_configuration_analysis_focus)
- `429`: Too many requests. Wait the number of seconds in the `Retry-After` header, then retry. See [Limits and durations](https://docs.scrip.dev/limits#rate-limits).
- `500`: Something failed on Scrip's side. Retry the request, and quote `request_id` if it keeps failing. [Errors](https://docs.scrip.dev/errors) lists every code, and the [API introduction](https://docs.scrip.dev/api-reference/introduction) describes the error format.

---

[API](https://skmtc.dev/scrip/apis/scrip-api.md) · [All operations](https://skmtc.dev/scrip/apis/scrip-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scrip/apis/scrip-api/revisions/c52d35da8d97?raw)
