PRE_GA · PILOT_OPEN
>_ PROTECTEDCODE · target:.NET/C# · baseline:private_endpoint · [WORKING_DESIGN]

AI-ASSISTED DEVELOPMENT, inside your Protected boundary.

PROTECTEDCODE runs approved coding models inside the Government of Canada environment your organization already operates — and makes your department's engineering standards active while the code is being written. Visual Studio and VS Code connect directly to a private endpoint; there is no proprietary extension to package, approve and deploy to managed workstations.

Your developers keep using the IDE they already have. The AI runs inside your approved environment instead of sending Protected code to a public coding service — and writes toward your architecture standards rather than against them.

The PROTECTEDCODE platform does not transmit source code, prompts, embeddings or retrieved application context to public AI services.

PROTECTED A/B PROFILESENGINEERING GUARDRAILS AS CODENO PUBLIC MODEL EGRESSPRE-INFERENCE SECRET DETECTIONCUSTOMER-CONTROLLED MODELSOFFLINE LICENSING
PRIVATE_ENDPOINT > SECRET_DETECTION > ENGINEERING_PROFILE > APPROVED_MODEL > ROSLYN_ANALYZERS > ARCHITECTURE_TESTS > CI_GATES > DECLARED_EVAL_GATES > OFFLINE_LICENSING > PRIVATE_ENDPOINT > SECRET_DETECTION > ENGINEERING_PROFILE > APPROVED_MODEL

// 01

THE PLATFORM NEVER SENDS YOUR CODE OR PROMPTS OUTSIDE THE DEPARTMENTAL BOUNDARY

$ diff public-ai protectedcode
STATUS_QUO

Public / SaaS AI Coding Tools

may not meet Protected-work requirements
  • Code and prompts leave the departmental boundary
  • Classification concerns can block adoption
  • Limited control over models, retention and logging
  • Department standards live in a document the model never sees
  • Per-seat or token-based cost exposure
  • Security review evidence may not transfer
PROTECTEDCODE

Private Endpoint + Bound Engineering Profile

deployed in an environment you already control
  • Protected context stays within approved paths
  • Backend choice follows departmental approval
  • Department controls identity, network and keys
  • Your architecture standards steer generation and review
  • Annual environment licence; customer pays compute
  • Reusable evidence artifacts by deployment profile

“You must consider the security classification of the code.” — Treasury Board Secretariat, Guide on the use of generative AI

Treasury Board guidance does not prohibit programming with generative AI. It requires that the tool and the infrastructure be appropriate to the classification of the code. The constraint is infrastructure, not permission — which changes the question from “are we allowed” to “where do we run it”.

// 02

FROM ANSWERING QUESTIONS TO HELPING BUILD SOFTWARE

$ stack --explain --plain-english

You do not need to be an AI specialist to understand the PROTECTEDCODE architecture. Think of it as adding capabilities to an assistant one layer at a time. The tag beside each layer says plainly where it stands today.

LLMTHE BRAIN● CORE

It reads, writes and reasons about code.

The large language model is the core reasoning engine. PROTECTEDCODE serves only an approved, validated model and version through the private coding endpoint. Your department controls where that model runs and which model is approved.

IN PLAIN ENGLISHThis is the part that understands the question and produces the answer.
+ RAGTHE LIBRARY◆ OPTIONAL MODULE

It lets the brain look things up before answering.

A coding model cannot be expected to already know your application, your architecture documents or your department's standards. Project-Isolated Code RAG gives the assistant controlled access to what is relevant to the repository it is working on — source code, approved technical documentation and internal standards — and retrieval stays scoped to the authorized project.

IN PLAIN ENGLISHInstead of asking the AI to guess how your application works, we let it open the correct books first.
+ MCPTHE NERVOUS SYSTEMFUTURE / CONTROLLED TOOL INTEGRATION

It provides controlled connections to approved tools and systems.

Model Context Protocol, or an equivalent approved interface, can give the assistant a standard way to work with internal engineering services — for example Azure DevOps, Git repositories, approved NuGet feeds, build and test services, architecture standards or vulnerability information. PROTECTEDCODE does not give the AI unrestricted access: every connection is explicitly approved, authenticated and constrained by policy.

IN PLAIN ENGLISHMCP is the wiring that can connect the AI brain to approved parts of your development environment.
+ SKILLSMUSCLE MEMORYPLANNED

They capture approved ways of performing common engineering work.

A skill is a reusable procedure the assistant can follow instead of rediscovering the process every time. Skills can combine department standards, Engineering Profiles, approved tools and validation steps. Examples could include:

modernize-legacy-servicecreate-unit-testsreview-clean-architecturecheck-accessibilityevaluate-new-nuget-packageprepare-security-review
IN PLAIN ENGLISHTeach the assistant the approved way to perform a task once, then let it reuse that method consistently.
+ AI AGENTTHE BRAIN + HANDS◆ PILOT / NEAR-TERM

It can plan work and safely perform approved actions.

An agent goes beyond answering a question. It can be given a goal, decide on a sequence of steps, use approved tools, inspect the result and continue until the bounded task is complete. A PROTECTEDCODE agent operates inside a sandbox with least-privilege access, tool allowlists, project boundaries, audit records and human confirmation where required.

“Update this service to use the approved logging pattern, build it, run the tests and show me the proposed diff.”
IN PLAIN ENGLISHThe LLM can think. The agent can think and do — but only inside the boundaries the department gives it.
$ stack --show-layers
ENGINEERING GUARDRAILS AS CODE“And I still have to follow your rules.” — applies from the first layer up
LLM“I can reason.”
+ RAG“I can look up your code and standards.”
+ MCP“I can connect to approved engineering tools.”
+ SKILLS“I know the approved way to perform this task.”
+ AI AGENT“I can safely carry out the task.”
capability ↑ ⇒ control ↑
More AI capability does not mean less control. As the assistant gains access to more context and more tools, PROTECTEDCODE is designed to apply stronger authorization, sandboxing, deterministic validation, audit and Engineering Guardrails as Code.

// 03

REQUEST FLOW · DIRECT TO A PRIVATE ENDPOINT

$ trace request --boundary
DIAGRAM_01 Protected Coding Data Flowhandle: arch/02
VISUAL STUDIO / VS CODEexisting AI provider settings
→
PRIVATE ENDPOINTOpenAI/Ollama-compatible
→
SECRET DETECTIONpre-inference inspection
→
APPROVED MODELyour compute · pinned version
↔
ENGINEERING PROFILEbound per repo/solution
[1] REQUEST
[2] SECRET_SCAN
[3] PROFILE
[4] INFER
[5] RESPOND
[6] VALIDATE
[7] CI_GATE
The base deployment is deliberately small. A centralized policy broker, project-scoped Code RAG, identity-aware retrieval authorization, audit and provenance services, and sandboxed agent tooling are modules — added where a customer's requirements justify them, not prerequisites for a working deployment. Self-hosted inference can run with no direct Internet egress from the AI data plane.
$ policy explain --request 7f2a
identity:       entra://department/user
project_scope:  benefits-modernization
profile:        clean-architecture@2.3          # bound to this repository
backend:        <department-approved model/version>
secret_scan:    PASS (pre-inference)
retrieval:      module not enabled in this deployment
public_ai:      NOT USED BY PROTECTEDCODE
audit:          request + decision + profile version

RESPONSIBILITY DEMARCATION

PRODUCT BOUNDARY STARTS AT THE PRIVATE ENDPOINT

DEPARTMENT / SSC OWNS

  • Managed workstation connectivity and device policy
  • ExpressRoute, VPN and GC network transport
  • Hub routing, firewall and approved source networks
  • Private DNS and enterprise name resolution
  • Landing-zone subscription, VNet and provisioning
  • Risk acceptance and the authorization decision

PROTECTEDCODE OWNS

  • Private endpoint and stable IDE-facing API
  • Pre-inference secret detection
  • Validated model/runtime profile and pinned versions
  • Engineering profile binding and validation hooks
  • Repeatable deployment packaging and validation report
  • Application evidence, threat model and control mappings
Department / SSC delivers traffic to the private endpoint. PROTECTEDCODE starts there.

// 04

ENGINEERING GUARDRAILS AS CODE

$ bind profile --repo benefits-modernization --profile clean-architecture@2.3

Most departments already have architecture standards. Most of them live in a document nobody opens, enforced — if at all — by an analyzer that rejects code after it has been written. PROTECTEDCODE binds the same standard into generation: architects publish versioned engineering profiles, each repository or solution binds a profile and version, the assistant receives that profile when it generates and reviews, and deterministic tooling then verifies the rules that can be enforced mechanically.

WITHOUT A BOUND PROFILE

Generate first, reject later

conformance is somebody else's problem
  • The assistant writes whatever it writes
  • A controller queries EF Core DbContext directly
  • The architecture test fails in CI — if one exists
  • Drift lands in the codebase and stays
  • Standards erode one merge at a time
WITH A BOUND PROFILE

Generate toward, then verify

conformance shifts left into generation
  • The assistant proposes an application-service boundary
  • Because that is what the active profile says
  • The architecture test proves the dependency is absent
  • Confirmation, not cleanup
  • Exceptions are explicit, versioned and reviewable
# .protectedcode/profile.yml — bound to this repository, versioned with it
profile:      clean-architecture
version:      2.3
owner:        enterprise-architecture

architecture:
  forbidden:  [ presentation -> infrastructure.persistence ]
  required:   [ use-case boundary for cross-aggregate writes ]
  validated_by: [ roslyn-analyzers, architecture-tests ]

security:
  packages:   approved-feed-only
  secrets:    no literals in source or prompts
  validated_by: [ sast, dependency-scan, secret-scan ]

web:
  baseline:   gc-web-accessibility
  validated_by: [ automated-a11y, human review ]

exceptions:
  - rule: presentation -> infrastructure.persistence
    scope: LegacyReportsController.cs
    approved_by: solution-architect
    expires: 2027-03-31
$ ls /profile/domains
[ARCHITECTURE]

Clean, Onion, Layered, Legacy Maintenance or your own pattern. Allowed and forbidden layer and project dependencies, declared per repository rather than imposed as one global house style.

validated_by: roslyn analyzers · architecture tests · project-reference rules
[CODING_STANDARDS]

Dependency injection, async, logging, exception handling, naming, API and testing conventions as your department actually writes them.

validated_by: compiler + analyzer rules · formatter · unit tests
[SECURITY_PACKAGES]

Authentication and authorization patterns, secret handling, cryptography rules, approved NuGet feeds and dependency policy.

validated_by: sast · secret scanning · dependency/SBOM checks · CI policy
[WEB_ACCESSIBILITY]

WET/GCWeb implementation guidance, accessible component patterns and WCAG requirements applied to generated and reviewed UI code.

validated_by: automated a11y testing · component tests · human review
[GOVERNANCE]

Profile ID and version, repository binding, migration status and approved deviations — so exceptions are visible rather than silent.

validated_by: versioned policy file · code review · exception workflow
Two layers, and we are explicit about which is which. Model instructions guide behaviour. They are not sufficient controls. Rules that can be enforced mechanically are backed by Roslyn analyzers, architecture tests, dependency and secret scanning, accessibility checks and CI gates — and where automation cannot prove a requirement, human review stays in the path. We do not claim enforcement we cannot demonstrate.
Start from working examples, not a blank schema. PROTECTEDCODE ships editable starter profiles — Clean Architecture, Onion, Layered, Legacy Maintenance and a GC web/accessibility baseline. A department customizes a working profile rather than authoring policy from scratch, and a legacy maintenance codebase and a greenfield service can sit under different profiles without pretending they are the same.

// 05

CAPABILITY NODES

core baseline + optional modules
NODE_01● CORE

Private Endpoint

A stable OpenAI/Ollama-compatible surface that abstracts the model behind it, with public model services blocked.

egress.public_model = denied
NODE_02● CORE

Pre-Inference Secret Detection

Prompt, code and context are inspected for credentials, connection strings, keys and tokens before anything reaches the model.

secret_scan = pre_inference
NODE_03● CORE

Engineering Profile Binding

A versioned profile is bound per repository or solution and supplied to the model as explicit generation and review context.

profile.scope = repository
NODE_04● CORE

Deterministic Validation Hooks

Roslyn, architecture-test, security, package and accessibility checks verify the rules that can be enforced mechanically.

enforcement != prompt
NODE_05● CORE

Model Governance

Only approved model and version profiles are served. Versions are pinned and never change silently underneath a team.

model.version = pinned
NODE_06● CORE

Offline Licence Validation

A locally validated signed licence avoids a supplier call-home dependency in restricted or disconnected environments.

license.callhome = false
NODE_07◆ MODULE

Project-Isolated Code RAG

Repository-aware retrieval with per-project indexes, retrieval-time authorization and provenance. Added where large or legacy solutions require it.

index.scope = project
NODE_08◆ MODULE

Policy Broker & Audit

Centralized identity-aware profile selection, model routing, provenance and SIEM-ready audit where direct clients cannot provide sufficient control.

audit.sink = customer_siem
NODE_09◆ MODULE

Sandboxed Agent Actions

Least-privilege workers, tool allowlists, diff review and confirmation gates. Retrieved repository text is never privileged instruction.

retrieval.privilege = none

// 06

DEPLOY WHERE YOU ALREADY HAVE AUTHORITY

$ ls /profiles
[PROTECTED_A]

Private workload and private AI processing. Management access follows the authorized landing-zone pattern; the data plane can remain isolated.

egress: approved management path only
[PROTECTED_B]

Stronger segmentation, private endpoints and centralized logging. Exceptions require explicit customer approval.

egress: deny by default / approved exception
The product is designed to support Protected A and Protected B deployment profiles — data-plane egress denied by default, separated management and import paths, private endpoints, deny-by-default routing and controlled logging. Which profile applies to a given workload, and whether that workload is authorized to run under it, is a departmental security decision and not something a product can confer.
$ ls /profiles/routes
[ROUTE_1A]

Departmental Azure Landing Zone. Preferred where the sponsoring department already has an approved landing zone and private connectivity — the fastest likely path to a paid pilot.

status: first-customer, preferred
[ROUTE_1B]

Departmental private cloud / on-premises / enterprise data centre, including VMware. Equivalent first-customer route where infrastructure and SA&A are already established, or dedicated isolation/GPU ownership is preferred.

status: first-customer, equivalent
[ROUTE_2]

GC AI Platform / SSC sovereign AI infrastructure. Pursued in parallel as a shared-infrastructure channel — not a dependency for first revenue until SSC confirms third-party workload onboarding.

status: strategic channel, parallel
[ROUTE_3]

Independent ThinkOn PBMM deployment. Alternate sovereign Canadian hosting where neither the departmental route nor GC AI Platform is presently suitable.

status: alternate sovereign host
The application layer is portable across all four routes, so choosing one now does not foreclose the others. Azure-hosted model services can be used where they are approved for the workload and reached through the authorized private architecture — that is a scoping decision made with your security team, not a default.

// 07

INTEGRATION TARGETS

$ which interface backend identity
01● PRIMARY

Visual Studio

Chat and agent workflows against your private endpoint using the IDE's own model-provider configuration. Feature-by-feature behaviour with public endpoints blocked is part of the pilot validation matrix.

endpoint: private
02● PRIMARY

VS Code

Model-provider extensions validated against the same private endpoint and Ollama/OpenAI-compatible protocol — no proprietary extension required.

endpoint: private
03● PROFILE

Self-Hosted Inference

Customer-controlled models run inside the AI data plane with no direct Internet egress.

isolation: maximum
04● TARGET

Entra ID

Existing Entra identity supports authentication and project authorization — no separate developer identity store.

auth: entra_aware
05● TARGET

Departmental SIEM

Request, policy and tool-action records remain in customer-controlled logging. Tamper-evident or signed capability can be deployment-specific.

sink: existing_siem
06● FUTURE

SSC GC AI Infrastructure

The endpoint can adopt future SSC-provided inference without replacing the engineering-governance layer above it.

route: future_profile

// 08

SECURITY POSTURE & ASSURANCE

private paths · deny by default · least privilege
The design does not claim that a private model automatically makes a workload Protected B. PROTECTEDCODE is built so the application can inherit your approved infrastructure controls, enforce code-specific controls of its own, and provide the evidence your department needs for its own authorization decision.
01

Private access

Use private endpoints where feasible; disable public access where supported.

02

Isolated data plane

Self-hosted inference and, where enabled, RAG and workers operate without direct Internet egress.

03

Deny by default

Routes and firewall rules allow only reviewed, deployment-specific exceptions.

04

Pre-inference secret detection

Request content is inspected for credentials and keys before it enters model context; block, redact or warn by policy.

05

Controlled logging

Records go to the departmental SIEM; prompt-body logging is minimized or disabled by default.

06

Separated management

Models, documentation and packages use a controlled import path separate from Protected traffic.

$ cat /eval/gates --declared-in-advance

Before a model and runtime are promoted for a pilot, pass/fail thresholds are declared in advance and recorded: grounded code-comprehension accuracy, build and test pass rates on bounded generation, legacy .NET task success, seeded architecture-rule detection, interactive and completion latency, and zero-tolerance gates for cross-repository retrieval leakage, secret exfiltration and policy escapes — each measured over a stated number of adversarial attempts. Thresholds change only by an explicit versioned decision, never after seeing a result.

THREATEXAMPLECONTROL
Repository prompt injectionA comment instructs the agent to ignore policyRetrieved text is never privileged instruction
Guardrail bypass / architectural erosionGenerated code follows the prompt but violates the active Clean/Onion rulesActive profile bound into generation; analyzers and architecture tests reject enforceable violations
Policy drift / stale standardsA repository stays bound to an obsolete architecture or accessibility profileVersioned profiles, recorded bindings, migration status and controlled upgrade decisions
Malicious dependencyVendored content targets the agentPackage provenance and sandboxed execution
Cross-project leakageA query retrieves another project's codePer-project indexes and retrieval-time authorization
Destructive actionAn agent changes or deletes unexpected filesAllowlist, diff review, confirmation and rollback
Model driftAn unreviewed model update changes behaviourPinned versions, evaluation gate and signed promotion
$ cat /claims --negative
✗
This is not an Authority to Operate.

PROTECTEDCODE is a product and a working design. Authorization is a departmental decision.

✗
A private model does not by itself make a workload Protected B.

The hosting boundary, the controls and your risk acceptance do that.

✗
Prompts are not controls.

Mechanically enforceable rules are verified by analyzers and tests, or they are not claimed.

✗
Accessibility conformance is not automated away.

Tooling catches part of it; human review remains in the path for the rest.

✗
Java is not a supported track yet.

C#/.NET today. Other ecosystems clear the same benchmark and evaluation bar before we claim them.

We supply application evidence, threat model, control mappings, secure-development evidence and test results. Your organization owns risk acceptance and the authorization decision.


// 09

WHY NOT JUST WAIT FOR A CENTRAL SERVICE?

$ cost-of-waiting --honest
Waiting is a legitimate option, and PROTECTEDCODE is not a bet against it. Shared Services Canada is building sovereign AI infrastructure, and a centrally provided developer capability may follow.
01● COST

It falls on your teams

Developers carrying Protected code stay without an approved capability for however long the wait lasts.

02● COST

Shadow AI keeps getting easier

Consumer tools become more reachable every quarter. The unsanctioned path does not pause while procurement does.

03● COST

No evidence accumulates

You learn nothing about what conformant AI-assisted development does to your codebase until you run some.

PROTECTEDCODE deploys in a boundary you already operate, and its application layer is built to move onto shared sovereign infrastructure when that path opens. A way to start now — not a competing destination.

// 10

LICENSING

$ cat /etc/protectedcode/license

Licensing is scoped per protected environment, with developer seats separate. You pay for your own approved compute and storage through your existing cloud or hosting arrangement; PROTECTEDCODE adds no token billing on top of it. Pilot and annual figures are scoped to the deployment and the number of developers — we would rather put real numbers against a real scope than publish a tier that fits nobody.

Pilot scopes are commonly sized to fit streamlined procurement authorities; confirm the applicable route with your contracting team.
[ENVIRONMENT]

An annual licence per protected environment covers the private endpoint, validated model and runtime profile, engineering-profile binding and validation hooks, deployment tooling and software updates.

unit: protected environment
[SEATS]

Developer seats are licensed separately so cost scales with realized use, and can be converted to enterprise bands where that simplifies procurement.

unit: named developer
[MODULES]

Code RAG, centralized policy broker, audit and provenance services and sandboxed agent tooling are licensed as modules, added when requirements justify them.

unit: module, per environment
[INFRASTRUCTURE]

Compute, storage and GPU are yours, billed by your own provider at your own rates. No token-based billing is added by PROTECTEDCODE.

billed_by: customer
[VALIDATION]

Licence validation uses a cryptographically signed file checked locally. No call-home to a supplier system is required, and restricted or disconnected environments are supported by design.

license.callhome = false
add-ons · separate engagement · statement-of-work based
Landing-zone deployment and SA&A evidence · engineering-profile authoring workshops · model evaluation and benchmarking · multi-year option planning
supported_config · department or GC Cloud One landing zone · departmental private cloud / VMware · Windows/Linux compute · Visual Studio and VS Code
out_of_scope · departmental network transport · endpoint management · customer compute/storage · contracting authority decisions

// 11

OPEN A SECURE CHANNEL

architecture review · pilot briefing
$ connect protectedcode.ca

channel: initial engagement
subject: private endpoint + engineering guardrails
> ready for architecture review_

A short technical discovery session with your development platform, architecture and security stakeholders: confirm which approved boundary a pilot would run in, agree what a pilot boundary looks like, and identify which repositories would benefit most from profile-bound assistance. Pilots begin on owned or Unclassified code, so quality, latency and no-egress behaviour are measured and documented before any Protected workload is involved.

Full architecture, security and Government of Canada strategy documentation available on request.
REQUEST_PILOT_BRIEFING · opens your email client