RuleFence developer guide
Extend the control model.
Never the privilege boundary.
Build on the WordPress Ability lifecycle with explicit identity, native authorization, narrower policy, readable evidence, and honest recovery limits.
managed_request {
identity: agent,
ability: registered,
input: fingerprinted,
environment: explicit
}EXECUTION LIFECYCLE
Architecture map
One lifecycle. Five responsibilities.
Keep each integration responsibility narrow. The complete boundary appears only when every layer remains visible.
Identify
Resolve the managed actor and environment.
Authorize
Preserve the registered WordPress permission result.
Decide
Apply agent policy that can only narrow access.
Execute
Run the registered Ability with bounded input.
Verify
Record the decision and observable outcome.
Security invariants
Extensions may add evidence. They may not add privilege.
Every provider and adapter stays inside the same control path. Treat these invariants as release-blocking contracts, not optional guidance.
- A native denial can never become permission
- Unknown Abilities remain blocked
- Approval is bound to the exact request
- Sensitive input stays out of evidence
Extension contracts
Add domain knowledge at explicit seams.
An integration improves classification, previews, verification, recovery, or presentation without bypassing the governed request path.
Classification metadata
Describe action, data, scope, risk, and reversibility conservatively.
Governed contractPreview provider
Summarize the expected change without executing the Ability.
Governed contractOutcome verification
Compare supported fields after execution and report what is known.
Governed contractSnapshot and restore
Capture and restore only fields the provider can support honestly.
Governed contractPolicy facts
Expose bounded facts that policy can use to become stricter.
Governed contractActivity rendering
Turn structured evidence into operator-readable operational language.
Governed contract// Describe; never grant.
provider {
classify( ability ),
preview( request ),
verify( before, after ),
snapshot( supported_fields ),
restore( snapshot )
}Provider design
Return evidence, not authority.
A provider should be deterministic where possible, conservative when uncertain, and explicit about unsupported fields or side effects.
- Validate against the live Ability registry
- Keep previews read-only
- Report Partial or Unverified honestly
- Refuse unsupported recovery claims
Management surface
Automate administration without creating a shadow control plane.
Management clients should use authenticated, versioned interfaces and preserve the same validation applied in wp-admin.
Versioned schemas
Treat request and response contracts as stable interfaces. Reject unknown or invalid shapes.
Least-privilege access
Use a dedicated WordPress user and expose only the management operations it needs.
Atomic changes
Validate live state before writing permission, policy, approval, or recovery changes.
Operational evidence
Record administration events without copying credentials or raw managed input.
Testing an integration
Test the stopped paths as carefully as the successful path.
A useful test suite proves that an integration stays safe when identity, authority, policy, approval, evidence, or recovery is missing.
- Unit-test classification and redaction
- Exercise native authorization failure
- Verify approval binding and replay refusal
- Confirm partial recovery stays partial
Release checklist
Ship only the behaviour you can prove.
Compatibility is a tested claim. Keep versions, environments, limits, and evidence attached to it.
Contract
Schemas and provider behaviour are versioned.
Boundary
Native authority and default deny are preserved.
Tests
Success, failure, replay, and redaction paths pass.
Evidence
Diagnostics state what was verified and what was not.
Continue building
Use the right reference for the next decision.
Start with the architecture and invariants, then move to the contract closest to the evidence your integration can provide.
Developer questions
Keep the contract honest.
When capability is uncertain, return less—not a broader promise.
Can an integration grant a WordPress Ability?+
No. It can describe or enrich a registered Ability, but it cannot bypass native WordPress authorization or create authority.
Does every provider need snapshots?+
No. Add recovery only when the provider can capture and restore supported state honestly.
Can diagnostics include raw request input?+
No. Preserve bounded, redacted evidence and keep credentials, tokens, cookies, customer records, and private keys out.
What should compatibility claims include?+
Name the tested plugin and version, WordPress environment, supported Ability names, behaviour verified, and known limits.
Build inside the boundary
Extend the evidence.
Preserve the authority ceiling.
Start with one Ability, one provider contract, and a complete stopped-path test matrix.
