Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
161231 stories
·
33 followers

Tell AI Everything Twice, Then Tell It a Second Time

1 Share
Imagine that you sit down with [Claude Code](https://claude.com/product/claude-code) or [Cursor](https://cursor.com) or [Copilot](https://github.com/features/copilot) to write a careful prompt: ```text Build an API that is multi-tenant. Every query must be scoped to the tenant ID grabbed from the JWT. Never, ever trust a tenant ID that comes in on the request body or query string. ``` You watch it scaffold the first few endpoints. It does exactly what you asked. The tenant ID comes off the JWT claims and gets passed into your repository calls. Feeling confident, you go get some coffee and come back fifteen minutes later. It's on endpoint number eleven now, and you watch it reading `tenantId` straight out of the query string. "What in the world?!" You didn't tell it to stop using the JWT. Is it stupid, or is it trying to sabotage you? ## AI: The Dumbest Genius If you tell AI to create a to-do app and sit back for a few minutes, it can create a flawless one 10 times as fast as you could have even typed in the code for one yourself. Enough experiences like this and you get lulled into a false sense of security. You start to feel like your AI assistant knows all. Imagine that you hired a developer, told them "the single most important rule on this project is tenant isolation," walked out of the room, and came back a minute later to find them writing an endpoint that lets any customer read any other customer's data. You'd assume something was wrong with them. For all our flaws, no human is going to forget a critical thing in just sixty seconds. And because we like to anthropomorphize our LLMs, it catches us by surprise when they do something this stupid. > **An LLM isn't remembering your requirements. It's predicting the next token, and your requirements are just one of many inputs that are tugging on that prediction.** When your instruction was thirty seconds ago, it still has a lot of pull over what your LLM does. Thirty minutes later, buried in the context under file contents and tool output and the LLM's own chatter, it has much less. By the time the LLM gets to implementing endpoint number eleven, it asks itself "what usually comes next here?", and the answer from the millions of examples it saw in training is "a tenantId parameter from the query string." Your one critical instruction is fading into the background. ## Where I've Watched It Forget Below are three places just recently where I gave the model a clear rule up front and it drifted anyway: ### Security I asked for a "secure" app and got one…mostly. It built out parameterized queries, used input validation on the DTOs, everything you would want! But then I ran a security scan after it was done (something like [Semgrep](https://semgrep.dev), [Snyk](https://snyk.io), or GitHub's [CodeQL](https://codeql.github.com)) and it flagged a raw `FromSqlRaw` with a string-interpolated `WHERE` clause. (For more on scanning AI-written code, see our post [Locking Down AI: Strategies for Uncovering Vulnerabilities](/locking-down-ai-strategies-for-uncovering-vulnerabilities/).) ### Architecture On a modernization project I told the model up front to use clean architecture, and that the Domain project should have no reference to EF Core because all persistence goes through repository interfaces. It set up the projects perfectly and wrote a nice little README explaining the rule, but about halfway through implementing the feature slices, a handler in the Application layer started newing up a `DbContext` directly because that was, frankly, the shortest path to making the test pass. ### Coding standards "Use our `Result` type for failures, don't throw exceptions for expected error cases." It followed the rule for the first six methods. Method seven, however, throws an `InvalidOperationException`. Method eight is back to `Result`. It's not even consistent about being wrong! If this is how these LLMs tend to work, then how do we write quality code with them? Better prompting isn't the fix, and neither is ALL CAPS. The answer is check gates. ## Requirements First, Check Gates After Here's the mental model that finally got me out of the "why do I have to keep saying this" loop: > **If something is important enough to tell the AI up front, it's important enough to check for afterward. The instruction is a requirement. The check is a separate gate that comes after.** On my projects, that looks like: ### 1. Put the rules where they get re-read Keep a [`CLAUDE.md`](https://academy.claude.com/courses/claude-code-101/the-claude-md-file) or [`AGENTS.md`](https://agents.md) at the repo root with your most important rules. These get pulled back into context every time you start a new session. Inside a long session it can still drift, but this resets what's critical every time you start fresh. ### 2. Turn the rules into tests An architecture test ([ArchUnitNET](https://archunitnet.readthedocs.io), or [NetArchTest](https://github.com/BenMorris/NetArchTest) if you're on the older stuff) that asserts the Domain project doesn't reference `Microsoft.EntityFrameworkCore` does more for you than a paragraph of prose about clean architecture. A [Roslyn analyzer](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/overview) that flags `FromSqlRaw` is better than the word "secure" in a prompt. If the model can break the rule silently, it sometimes will. If breaking the rule turns the build red, the model will fix it. ### 3. Run scans Security scan, dependency audit, whatever your equivalent is. Put it in your CI/CD process or tell the agent to run it itself and fix what it finds. In my experience, it's very good at fixing findings you feed to it. ### 4. Have a second model do a code review Ask a fresh session (or a different model entirely, [Codex](https://openai.com/codex/) reviewing Claude Code's output or vice versa) to review the diff against the original requirements. Give it the rules and the changes and nothing else. It has no memory of the shortcuts the first model took and no investment in them, and it catches things the original session would swear it didn't do. It's code review by someone who wasn't the developer, which is the whole point of code review. None of those are new ideas. We've had CI gates and code review and static analysis for over twenty years. What's new is realizing you need to apply them to LLMs as well as humans. And as I wrote in [Developing with AI Exposes Your Bottlenecks](/developing-with-ai-exposes-your-bottlenecks/), the gates are where the work piles up once coding gets fast, so they're worth investing in. ## Where the Analogy Breaks I've been talking about LLMs as a forgetful genius developer, and that's a useful analogy, but not perfect. After all, a human who forgets something will usually feel bad enough about it to not do it again. Your LLM might not make the same mistake *in the same session* after you correct it, but then it'll happily do it again tomorrow with another "Good catch!" when you point it out. It doesn't learn like that, so you need to set up your processes to catch its weaknesses. If you want help building a solid process around your AI-assisted development, [reach out to us at Trailhead](/contact-us/). We have a lot of experience building gates into our projects, and we'd be happy to help you tighten up your AI development processes.

The post Tell AI Everything Twice, Then Tell It a Second Time appeared first on Trailhead Technology Partners.

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Things That Caught My Attention Last Week - September 14

1 Share

caught-my-i

Software Architecture

We all wanted to be Netflix, who do we want to be next? by Oskar Dudycz

.NET

XPath for custom types in .NET by Gérald Barré

PostgreSQL Row-Level Security With EF Core and Npgsql by Milan Jovanović

Today I will... find hidden latency across a distributed .NET application by Visual Studio Blog

Use C# unions and closed hierarchies in ASP.NET Core by .NET Team

.NET and .NET Framework September 2026 servicing releases updates by .NET Team

Announcing .NET 11 Release Candidate 1 by .NET Team

Worse is better: C# versus F# by Mark Seemann

REST/APIs

Agent Resource Discovery (ARD): Sixty-Two Companies Declared An OpenAPI. They Spelled It Eleven Ways. by Kin Lane

Mintlify Does A Lot With One OpenAPI Extension by Kin Lane

Microsoft Works In The Open With 70,000 Engineers. You Can Publish Your API Documentation. by Kin Lane

Azure

September Patches for Azure DevOps Server by Azure DevOps Blog

MulticloudDB SDK: Cross-cloud portability in the coding agent era - Azure Cosmos DB Blog by Azure Cosmos DB Blog

Software Development

Architecture and model diffs via code conventions by Nick Tune

GitHub availability report: August 2026 by The GitHub Blog

AI

GitHub Copilot app for Beginners: Using the diff, terminal, and browser by The GitHub Blog

Agent Skills: New Value, New Problems by Kin Lane

Read the whole story
alvinashcraft
19 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Patching in 2026 with Susan Bradley

1 Share

How has patching changed in 2026? Richard chats with patching goddess Susan Bradley about what she's seeing in vendor patches and how they're affecting consumers and businesses. On one hand, you have the security risk of unpatched servers, which puts a lot of pressure on sysadmins to deploy patches immediately. And, at the same time, the number of patches has grown massively as tools like Anthropic's Fable have revealed far more vulnerabilities. Then there are the vendors that are slow to get fixes out for drivers and firmware for existing systems, increasing the risk of serious failures - it's not easy patching in 2026!

Links

Recorded Aug 21, 2026





Download audio: https://cdn.simplecast.com/media/audio/transcoded/5379899c-61c5-43c3-aa3f-1128cffd9ef4/c2165e35-09c6-4ae8-b29e-2d26dad5aece/episodes/audio/group/60e1970e-bf0d-4337-863a-1041053076b5/group-item/ed9c2510-851f-4750-b3a0-555d81240d4a/128_default_tc.mp3?aid=rss_feed&feed=cRTTfxcT
Read the whole story
alvinashcraft
6 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

MBW 1042: Tassels Galore! - iOS 27, iPadOS 27, and More Out Now!

1 Share

Apple held its first Apple event with John Ternus as CEO, and unveiled the iPhone Duo! Apple announced the Apple Watch Series 12 and Ultra 4 with a new AI feature called Siri Recap, bringing some concerns over its continuous ambient listening. And Apple wins 29 Emmys at the 78th Primetime Emmy Awards!

  • John Ternus enters, with folding phones and AI watches.
  • Apple unveils the iPhone Duo, a foldable phone that costs $1,999.
  • Apple Watch Series 12 and Ultra 4 unveiled with upgraded health tracking system.
  • Apple's always-listening watch features test eavesdropping laws.
  • Apple's OS 27 updates will be released on Monday, September 14th.
  • Apple hid a classic Mac easter egg in the iOS 27 Settings app.
  • pdfu on X: "iOS 27 and macOS Golden Gate have private hooks that let apps add Siri Extensions..."
  • Apple's Siri AI can be swapped out for Claude, ChatGPT, code shows.
  • macOS 27 Golden Gate review: Bridging the Tahoe gap.
  • visionOS 27 updates.
  • Apple wins most Emmys.

Picks of the Week

  • Christina's Picks: Spigen iPhone Duo Cast Concept & View Tweet extensions.
  • Andy's Pick: Mac Duo
  • Jason's Pick: Strategery 4
  • Leo's Pick: Homebrew 7

Hosts: Leo Laporte, Andy Ihnatko, Jason Snell, and Christina Warren

Download or subscribe to MacBreak Weekly at https://twit.tv/shows/macbreak-weekly.

Join Club TWiT for Ad-Free Podcasts!
Support what you love and get ad-free audio and video feeds, a members-only Discord, and exclusive content. Join today: https://twit.tv/clubtwit

Sponsors:





Download audio: https://pdst.fm/e/pscrb.fm/rss/p/mgln.ai/e/294/cdn.twit.tv/megaphone/mbw_1042/ARML6040453802.mp3
Read the whole story
alvinashcraft
6 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Introducing Microsoft 365 G7: Intelligence + Trust for the mission ahead

1 Share

Microsoft 365 G7 brings AI, Copilot, agent governance, security, and compliance together to help government agencies modernize securely.

The post Introducing Microsoft 365 G7: Intelligence + Trust for the mission ahead appeared first on Microsoft 365 Blog.

Read the whole story
alvinashcraft
12 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

PackageType: Main, Framework, Resource, Optional, Bundle

1 Share

Every MSIX package is one of four package types:

  • Main
  • Framework
  • Resource
  • Optional

MSIX also supports Bundle packages. Bundles are somewhat different from those four package types: a Bundle is a container for one or more MSIX packages. Windows APIs nevertheless expose Bundle alongside the other package types when identifying packages.

Each package type has its own behaviors, nuances, and rationale worthy of a dedicated discussion. We’ll take a brief whirlwind tour of MSIX package types here and explore them in greater detail in future blog posts.

What does PackageType imply?

What does PackageType actually mean?

MSIX packages have various properties and behaviors. A package type defines a predefined combination of properties and behaviors. Some are inherent to the package type, while others merely have defaults determined by the package type and can be overridden in AppxManifest.xml.

<packagedependency> is an example of a behavior constrained by package type. Main packages can declare static package dependencies, whereas Framework and Resource packages can’t.

Whether package content may execute is an example of a behavior whose default is based on package type but can be overridden via <uap6:allowexecution>. Main, Framework, and Optional packages permit execution by default, while Resource packages do not, unless the default is explicitly overridden.

For example, a Resource package can override its default behavior by declaring <uap6:AllowExecution>true</uap6:AllowExecution> in its AppxManifest.xml.

Main package

A Main package represents the primary package for an application.

Main packages are the package type developers and users encounter most frequently. A Main package can declare applications in AppxManifest.xml via <application>, as well as <capabilities>, <dependencies>, WinRT out-of-process (OOP) servers and more.

Windows Terminal (Microsoft.WindowsTerminal_8wekyb3d8bbwe), winappCLI (winapp_8wekyb3d8bbwe) and many more are Main packages.

There is no explicit “I am a Main package” marker in AppxManifest.xml. A package is a Main package when it does not declare itself to be another package type.

Framework package

Framework packages provide shared libraries, components, resources, or other runtime content for use by other packages or processes.

Conceptually, the relationship is closer to a shared component and the applications that consume it. A Framework package has package identity, but it does not represent an independently activated application of its own. Instead, its content can be incorporated into the package graph of processes that use it.

Framework packages also have special servicing semantics: multiple versions may remain installed side-by-side while applications transition from an older version to a newer one.

The Windows App SDK Framework package (Microsoft.WindowsAppRuntime.2_8wekyb3d8bbwe) is one example. It provides WinUI 3, PackageDeploymentManager and other APIs.

A package is a Framework package because it declares <framework>true</framework> in its AppxManifest.xml.

Resource package

Resource packages provide resources associated with another package.

Resource packages separate language-, scale-, and other resource-specific content from a Main or Optional package so Windows can install only the resources applicable to a device or user.

Images for varying display scales, localization data (text, images, etc.), and other resources are typically provided via Resource packages. Resource packages can include executable code, including DLLs and EXEs, if they declare <uap6:AllowExecution>true</uap6:AllowExecution>; spelling and grammar checkers are common examples of why a Resource package might need to allow execution.

A package is a Resource package because it declares <resourcepackage>true</resourcepackage> in its AppxManifest.xml.

Optional package

Optional packages contain additional content or code intended to be integrated with a specific Main package.

Unlike a Framework package, which can be used by multiple package families (and unpackaged processes1), an Optional package is associated with a particular Main package.

The concept behind Optional packages is to enable developers to break a large package into a required Main package and one or more optional packages. For example, a packaged game could have the game itself and additional optional elements. This could all be shipped in one Main package, but doing so can be undesirable when the additional content is large and many users don’t need it. Instead, the application could be split into multiple packages:

  • Game.msix – a Main package containing the core game.exe and game.dat
  • Maps.msix – an Optional package containing additional maps
  • MapEditor.msix – an Optional package containing mapeditor.exe2
  • HighRes.msix – an Optional package containing alternative high-resolution graphics

Downloadable Content (DLC) for games is one example of why developers might choose to use Optional packages. Many scenarios originally envisioned for Optional packages may now be better addressed by newer mechanisms. For example, plug-in architectures are often better served using Dynamic Dependencies together with AppExtensions or PackageExtensions.

A package is an Optional package because it declares a <uap3:mainpackagedependency>.

Bundle package

A Bundle package is somewhat different from other types of packages.

An MSIX bundle (*.msixbundle) is a container for one or more MSIX packages (*.msix).

For example, consider an application compiled for x86, x64, and Arm64, with separate MSIX packages for each architecture: Contoso.PointOfSale-x86.msix, Contoso.PointOfSale-x64.msix, and Contoso.PointOfSale-arm64.msix. The application might also support dozens of languages, display scales, and other resource qualifiers split across multiple Resource packages.

Managing all of those packages individually would be cumbersome. A Bundle such as Contoso.PointOfSale.msixbundle can contain them in a single distribution artifact.

A Bundle provides a convenient distribution unit while allowing deployment to select only the architecture and resource packages applicable to the target system.

All packages in a bundle belong to the same Package Family.

Bundle package identity uses a ResourceId of tilde (~ aka U+007E).

Synopsis

Type Primary purpose Manifest / identity indicator
Main Primary package for an application No other package-type declaration
Framework Shared runtime content <Framework>true</Framework>
Resource Applicability-specific resources <ResourcePackage>true</ResourcePackage>
Optional Additional content associated with a Main package <uap3:MainPackageDependency>
Bundle Distribution container for MSIX packages Bundle manifest; ResourceId="~" identity

Detect PackageType

The Windows.ApplicationModel.Package class exposes properties for identifying a package type:

PackageType Windows.ApplicationModel.Package property
Main !package.IsFramework && !package.IsResourcePackage && !package.IsOptional && !package.IsBundle
Framework package.IsFramework
Resource package.IsResourcePackage
Optional package.IsOptional
Bundle package.IsBundle

Detect via PowerShell

Get-AppxPackage reports several package-type properties:

Get-AppxPackage micro*win*app*run*2
...
PackageFullName   : Microsoft.WindowsAppRuntime.2_2.4.0.0_x64__8wekyb3d8bbwe
...
IsFramework       : True
...
IsResourcePackage : False
IsBundle          : False

Get-AppxPackage does not expose an IsOptional property analogous to IsFramework, IsResourcePackage, and IsBundle.

By default, Get-AppxPackage only enumerates Main and Framework packages. Use the -PackageTypeIdentifier parameter to filter by more (or fewer) types of packages. Specify -PackageTypeIdentifier Main,Framework,Resource,Optional,Bundle to match all package types. For example:

$(Get-AppxPackage Contoso.PointOfSale -PackageTypeIdentifier Main,Framework,Resource,Optional,Bundle).PackageFullName
...
Contoso.PointOfSale_1.2.3.4_arm64__8wekyb3d8bbwe
Contoso.PointOfSale_1.2.3.4_neutral_language-tlh_8wekyb3d8bbwe
Contoso.PointOfSale_1.2.3.4_neutral_language-qya_8wekyb3d8bbwe
Contoso.PointOfSale_1.2.3.4_neutral_scale-100_8wekyb3d8bbwe
Contoso.PointOfSale_1.2.3.4_neutral_scale-150_8wekyb3d8bbwe

What’s next?

Package type affects far more than a label. It influences package relationships, dependency resolution, execution, servicing, deployment, and runtime behavior.

This was the whirlwind tour. In future Inside MSIX posts we’ll explore the individual package types, their behaviors, and some of their less obvious consequences in considerably greater detail.


1 Framework packages can also be used by unpackaged processes via Dynamic Dependencies.

2 Optional packages containing executable code have additional requirements, including membership in a related set.

The post PackageType: Main, Framework, Resource, Optional, Bundle appeared first on Inside MSIX.

Read the whole story
alvinashcraft
12 minutes ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories