Skip to main content

Get Policy

Retrieve the current policy configuration for your organization.
curl -H "X-API-Key: sk_live_your_key_here" \
  https://api.turen.dev/api/v1/policy

Response

{
  "version": "v1.4.2",
  "name": "default",
  "updated_at": "2026-02-15T14:00:00Z",
  "rules": {
    "min_scorecard": 5.0,
    "review_scorecard": 8.0,
    "max_known_vulnerabilities": 5,
    "block_on_critical_vuln": true,
    "require_provenance": false,
    "allow_provenance_fallback": true,
    "review_on_new_package_days": 30,
    "allowed_licenses": ["MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "ISC"],
    "typosquat_action": "review",
    "typosquat_threshold": 0.85
  },
  "blocked_packages": [],
  "blocked_maintainers": []
}

Response Fields

FieldTypeDescription
versionstringPolicy version identifier
namestringPolicy name (default: “default”)
updated_atstringWhen the policy was last modified
rulesobjectPolicy threshold values
blocked_packagesarrayExplicitly blocked packages
blocked_maintainersarrayExplicitly blocked maintainers

Rules Fields

FieldTypeDescription
min_scorecardnumberMinimum OpenSSF Scorecard score (0-10). Below this = block.
review_scorecardnumberScore threshold for manual review (0-10)
max_known_vulnerabilitiesnumberMax allowed CVEs per package
block_on_critical_vulnbooleanBlock packages with critical CVEs
require_provenancebooleanRequire SLSA provenance
allow_provenance_fallbackbooleanAllow if provenance can’t be verified
review_on_new_package_daysnumberFlag packages newer than N days
allowed_licensesarrayList of allowed SPDX license identifiers
typosquat_actionstringAction for typosquat detection (block or review)
typosquat_thresholdnumberSimilarity threshold for typosquat detection (0-1)

Update Policy

Update policy thresholds for your organization.
curl -X PUT \
  -H "X-API-Key: sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "rules": {
      "min_scorecard": 7.0,
      "review_scorecard": 9.0,
      "max_known_vulnerabilities": 0
    },
    "blocked_packages": [],
    "blocked_maintainers": []
  }' \
  https://api.turen.dev/api/v1/policy

Request Body

FieldTypeDescription
rulesobjectPolicy threshold values to update (see Rules Fields above)
blocked_packagesarrayPackages to explicitly block
blocked_maintainersarrayMaintainers to explicitly block
Only include the fields you want to change within the rules object. Omitted fields retain their current values.

Response

Returns the updated policy (same schema as Get Policy).
Policy updates are distributed to agents at their next policy sync interval (every 15 minutes by default). No agent restart is required.