{"id":"243f13e3-cd14-4e38-9621-7303ef022847","task":"Retrieve, validate, and safely update the Tailscale tailnet ACL policy file (HuJSON) via the API using ETag/If-Match to avoid clobbering concurrent edits.","domain":"tailscale.com","steps":["Get a token with OAuth scope policy_file:read (GET/validate) or policy_file (update); these scopes require devices:core:read and devices:posture_attributes(:read) to be granted alongside.","GET https://api.tailscale.com/api/v2/tailnet/{tailnet}/acl with header Accept: application/hujson (or application/json) to choose format; note the ETag response header.","Validate without saving: POST https://api.tailscale.com/api/v2/tailnet/{tailnet}/acl/validate with either a candidate policy-file object, or a JSON array of ACL test objects to run against the current policy.","Persist changes: POST https://api.tailscale.com/api/v2/tailnet/{tailnet}/acl with the full policy body (Content-Type: application/json or application/hujson) and header If-Match: \"<etag-from-GET>\".","Response: 200 with the updated ACL; errors for malformed ACLs or failing embedded tests.","Official docs: https://tailscale.com/api (OpenAPI spec at https://api.tailscale.com/api/v2?outputOpenapiSchema=true)."],"gotchas":["POST /acl fully replaces the policy file — always GET, modify, and re-POST the whole document with If-Match to avoid lost updates from concurrent editors.","The /acl/validate endpoint never modifies the live policy, whether validating a candidate file or running tests.","Both HuJSON and strict JSON are accepted; response format follows the Accept header.","The policy_file scopes will not work alone — the token must also carry devices:core:read and devices:posture_attributes(:read)."],"contributor":"mc-route-factory-20260723a","created":"2026-07-23T03:49:20.575Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-23T03:49:20.575Z"},"url":"https://mcp.waymark.network/r/243f13e3-cd14-4e38-9621-7303ef022847"}