Conversational Walkthrough

A real /obfuscate session on a small ASP.NET Core service, exactly as it happened. You type four things.

Optional — you do not need an AI assistant. Everything below is Demeanor’s audit, dry run, obfuscation and demeanor init, relayed by the assistant. The manual walkthrough does the same work on the same service from the command line.

Requires your own Claude subscription — not included with Demeanor. The session was recorded with Claude Code, but Demeanor’s MCP server is spec-compliant — any MCP-capable assistant (Claude Desktop, Cursor, Windsurf, Continue.dev, VS Code MCP extensions, and others) drives the same loop.

The service

CatalogService is a small ASP.NET Core web service on .NET 11: Minimal API endpoints, an MVC health controller, EF Core, System.Text.Json with a source-generated context, Newtonsoft, and a [Serializable] legacy DTO. From the project folder, with DEMEANOR_LICENSE set:

dotnet build -c Release
claude

The grey lines below are Claude Code’s own record of what it ran. The assistant’s replies are as it wrote them.

The session

You

/obfuscate

Listed 1 directory, called demeanor 2 times, ran 2 shell commands

Audit done; checking how PluginHeartbeat is used before reporting.

Searched for 1 pattern, read 1 file, listed 1 directory
Claude

The audit found 12 framework patterns that keep their names automatically: EF Core, System.Text.Json, Newtonsoft, options binding, the MVC controller, [Serializable] and reflection lookups. Ask if you want the list.

One decision: CatalogService.Legacy.PluginHeartbeat

The audit says creating it with Activator.CreateInstance<T>() is rename-safe by itself. It only breaks if the instance is then serialized, mapped by an ORM or filled in by a container, because those match on property names.

In your code, LegacyPlugin.PostHeartbeat sets PluginName, Cycle and ReportedAt, then hands the object as a plain object to IHeartbeatCollector.Post. Nothing in this assembly implements that interface, so the collector lives somewhere else. Handing over an untyped object like that usually means it gets serialized.

  1. (recommended) Add [Obfuscation(Feature = "rename", Exclude = true, ApplyToMembers = true)] to PluginHeartbeat, plus using System.Reflection;. It keeps its names, and string encryption and control-flow obfuscation still apply to it.
  2. Add a <DemeanorExcludeSymbol> item to the .csproj instead, if you’d rather not put the attribute in the code.
  3. Rename it, if you know the collector never reads the property names.

Worth knowing: SerializeAuditRecord serializes by reflection. That’s fine for this build, but publishing with Native AOT (compiled ahead of time to native code) or trimming would raise IL2026 warnings and could drop AuditRecord’s properties. The minimal API handlers return JSON bodies too, and those types are already protected.

Which option do you want for PluginHeartbeat?

You

1

Updated Legacy\LegacyPlugin.cs
Called demeanor 5 times
Claude

I added [Obfuscation(Feature = "rename", Exclude = true, ApplyToMembers = true)] and using System.Reflection; to PluginHeartbeat in Legacy/LegacyPlugin.cs. The build succeeds and no decisions are left.

The dry run renamed 46% of types, 44% of methods, 78% of fields and 0% of properties. It also encrypted 86 strings and 51 constants, proxied all 7 call sites, flattened control flow in 101 of 250 methods, and injected anti-tamper, anti-debug and the reflection blocker. There are no embedded resources to encrypt.

Something unexpected: a lot of names, including every property, were kept only because they’re public. That rule exists for libraries other code compiles against. CatalogService is an app, so its public names aren’t a contract anything relies on. The framework types the audit protected stay protected either way.

Run it for real, renaming the public names too (include_publics)?

You

yes

Called demeanor 2 times
Claude

Done, with public names renamed too. Types are now 63% renamed, methods 54% and properties 23%. Most of the properties that kept their names belong to the EF Core, JSON and options types the audit protects.

  • Output: bin/Release/net11.0/Demeanor/
  • Report: bin/Release/net11.0/Demeanor/CatalogServiceReport.json. Keep it: it decodes stack traces from this build.

Wire it into the Release build so CI produces the same output?

You

yes

Ran 1 shell command
Updated CatalogService.csproj
Claude

The Release build now runs Demeanor, and a rebuild gave the same numbers as the manual run: 63% of types, 54% of methods and 23% of properties renamed, with 86 strings encrypted.

demeanor init added this to CatalogService.csproj, and I added the DemeanorIncludePublics line:

<!-- demeanor-init -->
<ItemGroup>
  <PackageReference Include="WiseOwl.Demeanor.MSBuild" Version="6.3.0" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
  <Obfuscate>true</Obfuscate>
  <DemeanorIncludePublics>true</DemeanorIncludePublics>
</PropertyGroup>

CI needs DEMEANOR_LICENSE as a secret; nothing else to install.

Files changed: CatalogService.csproj and Legacy/LegacyPlugin.cs.

What you typed

/obfuscate, 1, yes, yes. The audit found the twelve framework patterns and the one question; the assistant read the code around that question, applied your answer, and asked before each step that changes something. Every dotnet build -c Release from here on obfuscates the service the same way, on your machine and in CI.

Like what you just read?

Enterprise is a per-company subscription. Unlimited developers, unlimited build machines. The audit you just watched is the same one that runs against your code the moment you install — whether you drive it from the CLI or from your AI assistant. See pricing →

Buy EnterpriseDo it from the CLI

Next steps