Skip to content

feat(cli): add HIPAA placement flag for beta endpoints - #568

Open
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/deployment-compliance-policy-cli
Open

feat(cli): add HIPAA placement flag for beta endpoints#568
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/deployment-compliance-policy-cli

Conversation

@cursor

@cursor cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose beta endpoint deploy --placement.hipaa for HIPAA placement compliance policy
  • serialize the flag as placement.inline.compliancePolicy.hipaa
  • allow multiple inline placement options while keeping placement profiles mutually exclusive with inline placement

Tests

  • python3 -m pytest tests/cli/test_beta_endpoints.py
  • python3 -m ruff check src/together/lib/cli/api/beta/endpoints/_utils/_parameters.py src/together/lib/cli/api/beta/endpoints/deploy.py tests/cli/test_beta_endpoints.py
Open in Web View Automation 

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
@broly-code-security-scanner

Copy link
Copy Markdown

Broly Security Scan

Note

Clean scan
No vulnerabilities detected in this PR.

Note

Re-scan this PR anytime with /broly scan — useful after /broly undismiss, or to refresh findings without a new push.

Broly — SAST (zai-org/GLM-5.3) · Secrets · SCA · IaC · GH Actions · Base Images · Supply Chain Threats · Exploit Chains · Adversarial Verification

We're continuously improving Broly's accuracy and finding quality — your feedback is valuable. False positives, missed findings, bugs, and feature requests all welcome.

Ask in #security-engineering   Powered by Together AI



PlacementGroup = Group(validator=mutually_exclusive)
PlacementGroup = Group("Placement")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent why did this line change? I think we need to revert this one line.

@cursor cursor Bot Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Group(validator=mutually_exclusive) is why that line changed — and a literal revert is broken.

Cyclopts flattens PlacementModel into the same group, so mutually_exclusive treats every flag as exclusive:

--placement XOR --placement.regions XOR --placement.constraint XOR --placement.hipaa

That’s why HIPAA couldn’t ship with regions/constraint. I confirmed it: restoring that exact line makes test_deploy_sends_hipaa_compliance_policy fail with:

Error: Mutually exclusive arguments: {--placement, --placement.regions,
--placement.constraint, --placement.hipaa}

So I put a group validator back, but one that only exclusive-checks profile vs any inline:

def exclusive_profile_or_inline(arguments: ArgumentCollection) -> None:
    leaves = [argument for argument in arguments.filter_by(value_set=True) if not argument.children]
    has_profile = any(argument.field_info.name == "placement_id" for argument in leaves)
    has_inline = any(argument.keys for argument in leaves)
    if has_profile and has_inline:
        raise ValueError("Use either --placement or inline placement options, not both.")


PlacementGroup = Group(validator=exclusive_profile_or_inline)

--placement pp_1 --placement.hipaa still errors. --placement.regions + --placement.constraint + --placement.hipaa still combine. 20 tests green.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 11, 2026 20:29
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Cyclopts flattens PlacementModel fields into PlacementGroup, so
mutually_exclusive also rejects --placement.regions with --placement.hipaa.
Restore a group validator that only exclusive-checks a profile against
inline options.

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
@blainekasten
blainekasten marked this pull request as ready for review September 11, 2026 20:51
@blainekasten

Copy link
Copy Markdown
Collaborator

@cursoragent fix lint

@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Pyright was dying on compliance_policy["hipaa"]hipaa isn’t required on that TypedDict.

Switched the preview path to walrus + .get():

if (compliance_policy := inline.get("compliance_policy")) and (
    hipaa := compliance_policy.get("hipaa")
) is not None:
    add_row("--placement.hipaa", "true" if hipaa else "false")

./scripts/lint, ruff format --check, and the 20 CLI tests all pass.

Open in Web Open in Cursor 

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants