π‘οΈ title: 'Policy Builder Code Assist with PIP Intelligence' description: 'Use Smart Control Core Agent inside Policy Builder Code Editor for PBAC and PIP-aware Rego authoring.'
π‘οΈ Policy Builder Code Assist with PIP Intelligence
This guide explains how to use Smart Control Core Agent (SCCA) as an in-editor copilot while authoring Rego policies in the Policy Builder Code Editor.
π What this feature does
- Auto-activates SCCA when you are in Controls -> Policy Builder -> Code Editor.
- Uses sanitized editor context (resource, bouncer, effect, rego excerpt, environment).
- Interprets natural language PBAC intent:
- principal (user/agent/service identity)
- subject/resource scope
- action controls
- PIP context signals (risk, device, location, department, MFA, time)
- Returns explainable guidance in
What / Where / Risk / Next Stepformat.
π Prerequisites
- Smart Control Core Agent is enabled in Settings -> Smart Control Core.
- LLM provider is configured and reachable (training/development provider or customer production provider).
- At least one resource and bouncer are available in Control Plane.
- For stronger results, configure Data Sources (PIP) mappings for policy attributes.
π How to use
- Open Controls and start a new or existing policy.
- Go to Code Editor tab.
- Open SCCA (auto-available in this mode; use
Cmd/Ctrl + Kif needed). - Ask in plain language, for example:
Add principal constraints for contractors and service accounts.Allow read action only when risk score is low and MFA is true.Use PIP department and device trust to gate approval actions.
- Review response cards and snippet guidance.
- Apply edits manually in editor, then validate and test in simulator.
π Response model
SCCA responses are designed for non-technical policy managers:
- What: Code patch/snippet intent in plain language.
- Where: Resource + bouncer + code editor scope.
- Risk: What remains unchanged and what needs confirmation.
- Next Step: Concrete action (insert snippet, validate, run simulator).
π PIP intelligence behavior
- If mapped attributes exist, SCCA references them in guidance.
- If required signals are missing, SCCA suggests what to map next.
- SCCA never injects raw PII values into generated guidance.
π€ Safety and guardrails
- Code assist is non-mutating by default.
- Save/activate/promote actions still require explicit human confirmation.
- Confirmation payloads remain server-signed for multi-turn safety.
π οΈ Troubleshooting
| Symptom | Likely cause | Resolution |
|---|---|---|
| Code assist is not auto-available in builder | Not in Code Editor mode | Open Code Editor tab first, then reopen SCCA |
| Generic response with weak policy detail | Missing builder context or broad prompt | Add resource/action intent and ask for a specific patch |
| PIP-aware suggestions are limited | Missing Data Source mappings | Map required user/resource/context attributes in Data Sources |
| Draft creation/code assist fails with provider error | LLM credentials/model access issue | Verify provider settings and key in Smart CC settings |
π Related
- Control Core AI Pilot: AI Governance and Use
- AI Pilot Troubleshooting
- PIP Management - Administrator Guide
π‘οΈ title: "Policy Builder Code Assist" description: "Use Smart Control Core Agent inside Policy Builder Code Editor for PBAC and PIP-aware Rego authoring."
π‘οΈ Policy Builder Code Assist (PBAC + PIP)
This guide explains how to use Smart Control Core Agent (SCCA) as an in-editor copilot while writing Rego in Policy Builder β Code Editor.
SCCA is optimized for plain-language instructions and translates intent into policy code guidance based on:
- PBAC dimensions: principal, subject/resource, action
- Connected PIP metadata and mapped attributes
- Existing policy draft context in the editor
π What this feature does
- Auto-activates SCCA availability when Code Editor mode is active.
- Accepts natural-language instructions for Rego authoring and refactoring.
- Suggests PIP-aware constraints and flags missing attribute mappings.
- Keeps human-in-the-loop safety: no auto-save, no auto-activate.
π Dependencies
- Control Plane components:
control-plane-uiandcontrol-plane-api - Smart CC enabled in Settings β Smart Control Core
- Reachable configured model provider (Groq/OpenAI/Azure/etc.)
- Active protected resources + active bouncers
- PIP data sources configured and attribute mappings created
- Rego validation endpoint available (
/policies/validate-rego)
ποΈ Recommended workflow
- Open Controls and launch a draft in Policy Builder.
- Switch to Code Editor tab.
- Open SCCA (auto-available in this mode).
- Give natural-language instructions using PBAC format:
- Principal: who requests
- Resource: what is protected
- Action: what operation is controlled
- Context: which PIP signals should gate decision
- Apply returned snippet/patch guidance in the editor.
- Validate Rego, run conflict/readiness checks, then test in Control Simulator.
- Save/activate only after human review.
π Prompt examples
- βAdd principal checks for service accounts and deny unknown agents.β
- βRestrict delete action for non-admin users on payment resources.β
- βUse PIP
user.departmentandcontext.risk_scorebefore allow.β - βRefactor to Regal-friendly style and show missing attributes I should map.β
π Expected response shape
Each code-assist response should include:
- What / Where / Risk / Next Step cards
- Rego snippet or patch direction
- PIP dependency notes:
- attributes used
- missing signals to map
- Plain-language rationale for policy maintainers
π Safety and operating model
- Code assist is advisory, not mutating.
- Draft persistence and lifecycle changes remain explicit user actions.
- Context sent to Smart CC is sanitized; avoid placing raw secrets in prompts.
π οΈ Troubleshooting
| Symptom | Likely cause | Resolution |
|---|---|---|
| Code assist appears generic | Missing builder context | Re-open Code Editor and retry with explicit PBAC terms |
| No useful PIP suggestions | Attribute mappings incomplete | Map required user/resource/context fields in Data Sources |
| Turn fails with provider error | Invalid key/model/provider outage | Check Smart CC settings and provider credentials |
| Suggested code fails validation | Prompt too broad or conflicting logic | Retry with narrower instruction and run Rego validation again |