agentic-net-examples / encryption-and-protection
AGENTS.md1 starsChanged 2 months agoMITView on GitHub
Create secure, accurate Aspose.Cells for .NET examples that clearly distinguish access control, workbook/worksheet protection, write protection, file encryption, and digital signatures. Follow ../AGENTS.md. These features are not interchangeable: Never claim worksheet protection encrypts workbook contents or provides strong confidentiality. In scope: protect/unprotect workflows, locked/unlocked cells, workbook structure, open passwords, encryption providers/types, password-to-modify, signatures, certificate handling, protection verification, and security audits. Use macro-project for VBA editing, open-workbook for general loading, and document-properties for ordinary metadata. For file encryption, use the package-version-supported…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository32 other files it gives its agents.
- Aspose.Cells for .NET Product AgentAGENTS.md
- calculate-formulas/AGENTS.mdAGENTS.md
- cells-data/AGENTS.mdAGENTS.md
- comments-and-notes/AGENTS.mdAGENTS.md
- conversion/AGENTS.mdAGENTS.md
- document-properties/AGENTS.mdAGENTS.md
- format-cells/AGENTS.mdAGENTS.md
- globalization-and-localization/AGENTS.mdAGENTS.md
- macro-project/AGENTS.mdAGENTS.md
- manage-formulas/AGENTS.mdAGENTS.md
- manage-workbook/AGENTS.mdAGENTS.md
- managing-ranges/AGENTS.mdAGENTS.md
- open-workbook/AGENTS.mdAGENTS.md
- pivot-table/AGENTS.mdAGENTS.md
- queries-and-connections/AGENTS.mdAGENTS.md
- rows-and-columns/AGENTS.mdAGENTS.md
- save-workbook/AGENTS.mdAGENTS.md
- slicer/AGENTS.mdAGENTS.md
- smart-markers/AGENTS.mdAGENTS.md
- sparkline/AGENTS.mdAGENTS.md
- timeline/AGENTS.mdAGENTS.md
- workbook-merger/AGENTS.mdAGENTS.md
- working-with-charts/AGENTS.mdAGENTS.md
- working-with-html/AGENTS.mdAGENTS.md
- working-with-images/AGENTS.mdAGENTS.md
- working-with-json/AGENTS.mdAGENTS.md
- working-with-pdf/AGENTS.mdAGENTS.md
- working-with-shapes/AGENTS.mdAGENTS.md
- working-with-tables/AGENTS.mdAGENTS.md
- working-with-worksheets/AGENTS.mdAGENTS.md
- xml-maps/AGENTS.mdAGENTS.md
- llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 5 are common, 4 are distinctive, and 2 are very specific to this project.
≈5
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Create secure, accurate Aspose.Cells for .NET examples that clearly distinguish access control, workbook/worksheet protection, write …
- Distinctive: line 32
Never claim worksheet protection encrypts workbook contents or provides strong confidentiality.
- Very specific: line 38
Use macro-project for VBA editing, open-workbook for general loading, and document-properties for ordinary metadata.
- Common: line 42
Use placeholder passwords from environment/configuration in production-oriented examples.
- Common: line 43
Keep demonstration passwords obviously synthetic and warn that they are not production credentials.
- Common: line 44
Do not print passwords, private keys, certificate secrets, or decrypted content.
- Distinctive: line 45
Use a format that supports the requested protection/encryption feature.
- Distinctive: line 48
Never weaken encryption silently to maximize compatibility.
- Common: line 49
Do not use a password hint that reveals the password.
- Distinctive: line 72
Verify APIs and algorithms against the installed package and current product documentation.
- Common: line 75
Test invalid credentials only when failure can be asserted safely.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
Encryption and Protection Agent Instructions
Mission and security boundary
Create secure, accurate Aspose.Cells for .NET examples that clearly distinguish access control, workbook/worksheet protection, write protection, file encryption, and digital signatures. Follow ../AGENTS.md.
These features are not interchangeable:
| Security goal | Mechanism |
| Require a password to open a file | Workbook file encryption/load password |
| Restrict worksheet actions | Worksheet.Protect with ProtectionType and allowed operations |
| Protect workbook structure/windows | Workbook protection/settings APIs verified for the format |
| Mark or restrict modification | Write-protection/password-to-modify APIs |
| Verify origin/integrity | Digital signature APIs and certificates |
| Protect VBA project | VBA project protection/signing APIs |
Never claim worksheet protection encrypts workbook contents or provides strong confidentiality.
Scope
In scope: protect/unprotect workflows, locked/unlocked cells, workbook structure, open passwords, encryption providers/types, password-to-modify, signatures, certificate handling, protection verification, and security audits.
Use macro-project for VBA editing, open-workbook for general loading, and document-properties for ordinary metadata.
Hard rules
- Use placeholder passwords from environment/configuration in production-oriented examples; never hard-code real secrets.
- Keep demonstration passwords obviously synthetic and warn that they are not production credentials.
- Do not print passwords, private keys, certificate secrets, or decrypted content.
- Use a format that supports the requested protection/encryption feature.
- Validate by reopening with the correct password and, where safe, confirming failure with an incorrect password.
- Explain what attackers are and are not prevented from doing.
- Never weaken encryption silently to maximize compatibility.
- Do not use a password hint that reveals the password.
Canonical worksheet pattern
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells["A1"].PutValue("Protected content");
worksheet.Protect(ProtectionType.All, "ExampleOnly-Password", null);
workbook.Save("protected-worksheet.xlsx");For file encryption, use the package-version-supported load/save encryption APIs rather than repurposing worksheet protection.
Example contract
Each example must name the protected asset, threat/intent, mechanism, format, credential source, allowed operations, and verification. Use explicit types and synthetic data. Prefer filenames such as encrypt-xlsx-with-open-password.cs or protect-excel-worksheet-in-csharp.cs.
Signature examples must identify whether they add a visible signature line or a cryptographic signature. Certificate examples must use a test certificate and never assume access to a machine certificate store in CI.
Enterprise validation
- Verify APIs and algorithms against the installed package and current product documentation.
- Build and run without exposing secrets.
- Reopen with valid credentials and verify protected flags/content.
- Test invalid credentials only when failure can be asserted safely.
- Confirm the saved format retains the intended control.
- For signatures, verify signature validity after save and detect post-sign modification.
Reject examples that confuse protection with encryption, contain real credentials, depend silently on Windows-only certificate state, or claim compliance/certification without evidence.
SEO, GEO, and AEO
Target one direct question: "password protect Excel in C#," "encrypt XLSX without Excel," "lock cells," or "digitally sign an Excel file." The opening comment must identify the asset and mechanism. Use precise security language over marketing claims.
Related knowledge
- Category overview
- Open workbook
- Macro projects
- Official protection and encryption documentation
Definition of done
The example is done when the security objective, mechanism, limitation, credential handling, format support, and verification are explicit and correct.
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.

