ApplicationInspector
Copilot instructions4.4k starsChanged 10 months agoMITView on GitHub
Microsoft Application Inspector is a source code characterization tool that identifies coding features based on well-known library/API calls using regex patterns and rules. It supports multiple programming languages and generates reports in HTML, JSON, SARIF, and text formats. Version Tracking: This project uses Nerdbank.GitVersioning (nbgv) for version tracking, which requires a deep clone of the repository. Shallow clones will not work correctly with version generation. NuGet Packages: The repository uses a custom nuget.config that points to a private Azure DevOps…
Trending
Quiet since February.about the whole repository
Who's talking about microsoft/ApplicationInspector
- A Hacker News story“Microsoft Application Inspector”Hacker News · Jan 28, 2020 · 419 points
- A Hacker News story“Microsoft Application Inspector: code analyzer for surfacing characteristics”Hacker News · Jan 23, 2020 · 2 points
- A Hacker News story“Microsoft Application Inspector”Hacker News · Jan 21, 2020 · 2 points
- A Hacker News story“ApplicationInspector: A software characterization source code analyzer”Hacker News · Jan 21, 2020 · 2 points
- A Hacker News story“Microsoft Application Inspector: source code characterization tool”Hacker News · Feb 25, 2025 · 1 points
The biggest 5 of 29 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 29
Talked about on GitHub and Hacker News (29 times).
On GitHub · 24
- Jan 18, 2020ApplicationInspector-微软开源的源代码分析与检测工具 — Git-News/Git-News1 reaction · 1 comment
- Feb 4, 2026Anchor .config regex to prevent matching .config.json files — microsoft/DevSkim0 reactions · 8 comments
- Apr 7, 2024Aggregate various tools and data for scoring/ratings/features-eval of packages — aboutcode-org/purldb0 reactions
- Mar 23, 2022Refactor DevSkim to use the Application Inspector RulesEngine — microsoft/DevSkim0 reactions · 3 comments
- Sep 14, 2021microsoft/ApplicationInspector — pipeline-foundation/projects0 reactions
19 more on GitHub
- Jul 23, 2021Consider moving crypto library detections to Application Inspector — microsoft/OSSGadget0 reactions
- Jul 23, 2021Port ApplicationInspector#370 to DevSkim — microsoft/DevSkim0 reactions
- Jul 2, 2021Bump Application Inspector — microsoft/OSSGadget0 reactions · 1 comment
- Sep 15, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Sep 12, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Sep 7, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Sep 5, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Sep 4, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Sep 3, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Aug 31, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Aug 27, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Aug 23, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Aug 22, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Aug 9, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Jul 13, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- Jul 9, 2020Link Checker Report — analysis-tools-dev/static-analysis0 reactions
- May 21, 2020Use ConcurrentStack instead of List for thread safety — microsoft/OSSGadget0 reactions
- Jan 31, 2020Microsoft Application Inspector — pel-daniel/mind-bicycles0 reactions
- Jan 23, 2020Investigate ApplicationInspector — angrykoala/oslint0 reactions
On Hacker News · 5
- Jan 28, 2020Microsoft Application Inspector419 points · 61 comments
- Jan 23, 2020Microsoft Application Inspector: code analyzer for surfacing characteristics2 points
- Jan 21, 2020Microsoft Application Inspector2 points
- Jan 21, 2020ApplicationInspector: A software characterization source code analyzer2 points
- Feb 25, 2025Microsoft Application Inspector: source code characterization tool1 point
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
31 rules. About 0 are common, 19 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 39
IMPORTANT: Never check in changes to nuget.config.
- Distinctive: line 83
Follow standard C# naming conventions (PascalCase for public members, camelCase for private fields)
- Distinctive: line 84
Use meaningful, descriptive names for variables, methods, and classes
- Distinctive: line 85
Keep methods focused and single-purpose
- Distinctive: line 86
Add XML documentation comments for public APIs
- Distinctive: line 87
Use nullable reference types where appropriate
- Very specific: line 88
Prefer var for local variables when the type is obvious
- Distinctive: line 89
Use LINQ for collection operations when it improves readability
- Very specific: line 93
Namespace Structure: Follow the project name structure (e.g., Microsoft.ApplicationInspector.Commands)
- Very specific: line 94
Logging: Use the logging infrastructure from AppInspector.Logging namespace
- Distinctive: line 96
Async/Await: Use async methods for I/O operations.
- Distinctive: line 133
Use specific patterns: Prefer specific API/class names over generic words to reduce false positives
- Very specific: line 134
Word boundaries: Use \b in regex patterns or regexword type to prevent matching substrings
- Very specific: line 135
Avoid catastrophic backtracking: Don't use unlimited repetition patterns like .* in regex
- Very specific: line 139
Conditions: Use conditions with same-line search to ensure API methods are invoked, not just referenced
- Very specific: line 140
Pattern for invocation: Use .Method( patterns instead of Class.Method to catch actual usage via variables
- Distinctive: line 174
Ensure new rule IDs don't conflict with existing ones
- Very specific: line 182
Test classes organized under AppInspector.Tests/Commands/
- Very specific: line 183
Test data located in AppInspector.Tests/TestData/
- Distinctive: line 184
Use descriptive test method names that explain what is being tested
- Very specific: line 185
Use test fixtures (IClassFixture<>) for shared setup/teardown
- Distinctive: line 206
No hardcoded secrets: Never commit credentials, API keys, or sensitive data
- Distinctive: line 208
Safe regex: Avoid regex patterns that can cause catastrophic backtracking
- Distinctive: line 209
Secure defaults: Use secure defaults for cryptographic operations
- Very specific: line 210
Sanitization: Use appropriate sanitizers (e.g., html_escape) to prevent injection vulnerabilities
- Distinctive: line 214
Regex compilation: Consider caching compiled regex patterns for frequently used rules
- Distinctive: line 215
File I/O: Use async I/O for file operations
- Distinctive: line 221
Rule regex performance: Avoid complex regex patterns that can cause performance issues on large files
- Distinctive: line 222
False positives: Test rules thoroughly to minimize false positive detections
- Distinctive: line 224
Platform dependencies: Ensure code works across Windows, Linux, and macOS
- Distinctive: line 266
Check BUILD.md for detailed build instructions
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot Instructions for ApplicationInspector
Project Overview
Microsoft Application Inspector is a source code characterization tool that identifies coding features based on well-known library/API calls using regex patterns and rules. It supports multiple programming languages and generates reports in HTML, JSON, SARIF, and text formats.
Tech Stack
- Language: C# (supports netstandard2.1; .NET 8.0+ for executables; aims to support all currently supported .NET versions)
- Build System: dotnet CLI
- Test Framework: xUnit
- Solution Structure: Multi-project .NET solution with 7 projects
- Rule Format: JSON files following rule-schema-v1.json schema definition in repository root
Project Structure
AppInspector.CLI/- Command-line interface applicationAppInspector/- Core commands library (AppInspector.Commands.csproj)AppInspector.RulesEngine/- Rule processing and pattern matching engineAppInspector.Common/- Common utilities and typesAppInspector.Logging/- Logging infrastructureAppInspector.Tests/- Test suite using xUnitAppInspector.Benchmarks/- Performance benchmarksAppInspector/rules/default/- Built-in detection rules organized by category
Build and Test Commands
Important Build Notes
Version Tracking: This project uses Nerdbank.GitVersioning (nbgv) for version tracking, which requires a deep clone of the repository. Shallow clones will not work correctly with version generation.
NuGet Packages: The repository uses a custom nuget.config that points to a private Azure DevOps feed. If you need to restore packages and don't have access to the private feed, you may need to temporarily modify nuget.config to pull from nuget.org instead:
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>IMPORTANT: Never check in changes to nuget.config. The private feed configuration should remain in the repository.
Building
# Build debug version
dotnet build
# Build release version
dotnet build -c Release
# Platform-specific publish
dotnet publish -c Release -r win10-x64
dotnet publish -c Release -r linux-x64
dotnet publish -c Release -r osx-x64Testing
# Run all tests
dotnet test
# Run specific test project
dotnet test AppInspector.Tests/AppInspector.Tests.csproj
# Run tests with verbose output
dotnet test --verbosity normalRunning the CLI
# Analyze code
dotnet run --project AppInspector.CLI -- analyze -s path/to/source
# Verify rules
dotnet run --project AppInspector.CLI -- verifyrules -r path/to/rules
# Export tags
dotnet run --project AppInspector.CLI -- exporttagsCoding Standards and Conventions
General C# Guidelines
- Follow standard C# naming conventions (PascalCase for public members, camelCase for private fields)
- Use meaningful, descriptive names for variables, methods, and classes
- Keep methods focused and single-purpose
- Add XML documentation comments for public APIs
- Use nullable reference types where appropriate
- Prefer
varfor local variables when the type is obvious - Use LINQ for collection operations when it improves readability
Specific Project Conventions
- Namespace Structure: Follow the project name structure (e.g.,
Microsoft.ApplicationInspector.Commands) - Logging: Use the logging infrastructure from
AppInspector.Loggingnamespace - Error Handling: Return structured result types rather than throwing exceptions for expected failures
- Async/Await: Use async methods for I/O operations; follow the Task-based Asynchronous Pattern (TAP)
Rule Development Guidelines
Rule File Structure
Rules are JSON files located in AppInspector/rules/default/ organized by category:
cryptography/- Cryptographic operationssecurity_feature/- Security-related features (authentication, authorization, etc.)data_handling/- Database, serialization, deserializationos/- Operating system operations (file I/O, process execution, reflection)cloud_services/- Cloud platform APIsframeworks/- Framework detection- And more...
Rule Schema Requirements
The rule schema is defined in rule-schema-v1.json in the repository root.
Each rule must include:
id- Unique identifier (format: AI######, e.g., AI038900)name- Human-readable nametags- Array of tags describing the feature (e.g., "Authentication.Microsoft.Online")patterns- Array of pattern objects for detectiondescription- Optional detailed descriptionseverity- Optional: Critical, Important, Moderate, BestPractice, ManualReview, Unspecifiedapplies_to- Optional: array of language identifiers (e.g., ["csharp", "java"])
Pattern Types
string- Literal string matchregex- Regular expressionregexword- Regex with word boundaries automatically addedsubstring- Substring match
Pattern Best Practices
- Use specific patterns: Prefer specific API/class names over generic words to reduce false positives
- Word boundaries: Use
\bin regex patterns orregexwordtype to prevent matching substrings - Avoid catastrophic backtracking: Don't use unlimited repetition patterns like
.*in regex - Test cases: Include
must-matchandmust-not-matchtest cases in rules for validation - Confidence levels: Set appropriate confidence (high, medium, low) based on pattern specificity
- Scopes: Specify appropriate scopes (code, comment) to limit false positives
- Conditions: Use conditions with
same-linesearch to ensure API methods are invoked, not just referenced - Pattern for invocation: Use
.Method(patterns instead ofClass.Methodto catch actual usage via variables
Example Rule Pattern
{
"name": "Authentication: Microsoft (Identity)",
"id": "AI038900",
"description": "Authentication using Microsoft Identity Platform (ADAL/MSAL)",
"tags": ["Authentication.Microsoft.Online"],
"severity": "critical",
"patterns": [
{
"pattern": "microsoft\\.msal",
"type": "regexword",
"scopes": ["code"],
"confidence": "high"
},
{
"pattern": "AcquireTokenForClient",
"type": "regexword",
"scopes": ["code"],
"confidence": "high"
}
]
}Note: This is a simplified example. Real rules may use alternation (e.g., pattern1|pattern2) to match multiple alternatives in a single pattern.
Rule ID Conventions
- Rule IDs follow consistent patterns within categories
- Authentication rules: AI038900 - AI041999 range
- Ensure new rule IDs don't conflict with existing ones
- Sequential numbering within a category
Testing Conventions
Test Organization
- Tests use xUnit framework
- Test classes organized under
AppInspector.Tests/Commands/ - Test data located in
AppInspector.Tests/TestData/ - Use descriptive test method names that explain what is being tested
- Use test fixtures (
IClassFixture<>) for shared setup/teardown
Test Patterns
[Fact]
public void TestMethodName_Scenario_ExpectedBehavior()
{
// Arrange
var options = new AnalyzeOptions { /* ... */ };
// Act
var result = command.GetResult();
// Assert
Assert.True(result.ResultCode == AnalyzeResult.ExitCode.Success);
}Security Considerations
- No hardcoded secrets: Never commit credentials, API keys, or sensitive data
- Input validation: Validate all user inputs, especially file paths and patterns
- Safe regex: Avoid regex patterns that can cause catastrophic backtracking
- Secure defaults: Use secure defaults for cryptographic operations
- Sanitization: Use appropriate sanitizers (e.g.,
html_escape) to prevent injection vulnerabilities
Performance Considerations
- Regex compilation: Consider caching compiled regex patterns for frequently used rules
- File I/O: Use async I/O for file operations
- Memory usage: Be mindful of memory when processing large codebases
- Parallel processing: Leverage parallel processing where appropriate for scanning multiple files
Common Pitfalls to Avoid
- Rule regex performance: Avoid complex regex patterns that can cause performance issues on large files
- False positives: Test rules thoroughly to minimize false positive detections
- Breaking changes: Maintain backward compatibility in rule schema and command-line interface
- Platform dependencies: Ensure code works across Windows, Linux, and macOS
- Resource cleanup: Properly dispose of file handles and other resources
Code Review Checklist
Before submitting changes:
- Code builds without errors (
dotnet build) - All tests pass (
dotnet test) - New rules include test cases (must-match and must-not-match)
- New rules validate successfully (
dotnet run --project AppInspector.CLI -- verifyrules) - XML documentation added for public APIs
- No hardcoded secrets or sensitive data
- Changes are backward compatible
- Performance impact considered for rule changes
Useful Commands
# Verify rule syntax
dotnet run --project AppInspector.CLI -- verifyrules -r AppInspector/rules/default/
# Pack rules into single file
dotnet run --project AppInspector.CLI -- packrules -r AppInspector/rules/default/ -o packed-rules.json
# Run benchmarks
dotnet run --project AppInspector.Benchmarks -c Release
# Clean build artifacts
dotnet cleanResources
Getting Help
- Review the CONTRIBUTING.md for contribution guidelines
- Check BUILD.md for detailed build instructions
- See SECURITY.md for security reporting procedures
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

