<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Rohit]]></title><description><![CDATA[Rohit is a personal publication sharing thoughtful writing, ideas, experiences, lessons, and practical knowledge to help readers learn, think, and grow.]]></description><link>https://rohitjart.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 22 Oct 2026 15:07:15 GMT</lastBuildDate><atom:link href="https://rohitjart.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Protect Sensitive Data When Sending Requests to AI APIs]]></title><description><![CDATA[Learn how to minimize PII exposure, secure AI API keys, validate model outputs, and understand data retention when building AI-powered applications.]]></description><link>https://rohitjart.hashnode.dev/how-to-protect-sensitive-data-when-sending-requests-to-ai-apis</link><guid isPermaLink="true">https://rohitjart.hashnode.dev/how-to-protect-sensitive-data-when-sending-requests-to-ai-apis</guid><category><![CDATA[AI]]></category><category><![CDATA[Security]]></category><category><![CDATA[api]]></category><category><![CDATA[privacy]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Rohit P]]></dc:creator><pubDate>Fri, 16 Oct 2026 10:47:45 GMT</pubDate><content:encoded><![CDATA[<p>A developer’s guide to minimizing PII exposure, securing API keys, and complying with data-retention policies when integrating AI into your app.</p>
<p>AI APIs allow adding such features as summarizing, analyzing documents, providing chat help, and automating business workflows to applications. Still, when you integrate a model, there is a critical security issue you have to consider how to handle information that your application is sending and receiving.</p>
<p>Your prompt might contain personal names, internal documents, accounts or references, or snippets from the help conversation. When your integration sends unnecessary information or saves the request in an insecure manner, the sensitive information finds its way into the wrong places.</p>
<p>Securing an AI integration requires more than protecting API keys. Developers must also minimize the data they share, control access, validate model outputs, and understand how their AI provider handles submitted information.</p>
<h2>Knowing What Goes Out from Your Application</h2>
<p>Prior to sending an AI API call, understand what goes out in that call.</p>
<p>A request may contain:</p>
<ul>
<li><p>User instructions and prompts</p>
</li>
<li><p>Uploaded files or extracted document text</p>
</li>
<li><p>Customer records and conversation history</p>
</li>
<li><p>Application metadata and internal identifiers</p>
</li>
<li><p>Credentials or configuration details accidentally included in the request</p>
</li>
</ul>
<p>Pay special attention to responses as well since models might produce data that should not be accepted without verification.</p>
<p>For example, there is a support application that requests to summarize a customer complaint by an AI model. There is no need to pass all customer data when the model just needs to know the description and the product category of the issue.</p>
<p>The first security action would be knowing the list of fields that go into the call, their origin, and necessity.</p>
<h2>Reduce Sensitive Information Before Sending It</h2>
<p>Data minimization refers to sending only the data necessary for completing a certain task.</p>
<p>In case the application requires categorizing the support request, it may not require the customer's full name, email, phone number, or account number.</p>
<p>Instead of sending:</p>
<p>{</p>
<p>"customer_name": "Jane Example",</p>
<p>"email": "<a href="mailto:jane@example.com">jane@example.com</a>",</p>
<p>"account_number": "ACC-58291",</p>
<p>"message": "I cannot access my account."</p>
<p>}</p>
<p>The application can send:</p>
<p>{</p>
<p>"request_id": "req_1042",</p>
<p>"message": "I cannot access my account."</p>
<p>}</p>
<p>These are just illustrative examples; whether the request ID will be needed will depend on the task.</p>
<p>If the task requires context based on personal data, think about masking or replacing the identifiers before sending the request. The application may replace a name with a token and keep the mapping in its internal secure storage.</p>
<p>Please note that pseudonymization does not guarantee anonymization. If your application can connect the token with the person's identity, the data can still be considered potentially identifiable.</p>
<h2>Protecting API Keys in the Client-Side Code</h2>
<p>AI provider API keys should never be embedded in browser-side JavaScript, mobile application bundles, public repositories, or configuration files committed to version control.</p>
<p>Instead, requests are sent to the back end in such an architecture:</p>
<p>Browser or Mobile App -&gt; Application Backend -&gt; Authentication and Authorization -&gt; AI API Provider -&gt; Backend Validates Response -&gt; Application Client</p>
<p>The back end stores the credentials in a proper secrets manager or server-side configuration.</p>
<p>The back end must verify that the user has the authority to carry out the specified action and impose usage restrictions.</p>
<p>In case of any leaks of the key, revoke or replace the key immediately and determine whether the key was used without authorization. Simply deleting the key from the most recent code version does not remove it from past revisions in the repository.</p>
<h2>Protect Data in Transit and at Rest</h2>
<p>AI integration usually involves transfer of data between client-side applications, application servers, databases, logging frameworks, and third-party suppliers.</p>
<p>Use HTTPS with proper TLS configuration. Avoid bypassing certificate validation in production to overcome any connectivity issues.</p>
<p>In case prompts, responses, or related data need to be saved, secure them using adequate storage encryption and access management. Limit access to those who actually need it.</p>
<p>Encryption does not solve the problem of access control on its own. It is still an access control vulnerability if the application allows all employees to access all stored prompts regardless of <a href="https://jbcodeapp.com/services/web/hire-database-developers/">database</a> encryption.</p>
<h2>Know the rules concerning the provider's data retention</h2>
<p>ifferent AI providers have different rules for processing, retaining, and using submitted data. Do not assume that one provider's policies apply to another.</p>
<p>For example, OpenAI states that API data is not used to train or improve its models by default, unless the customer opts in. Its documentation also describes default abuse-monitoring logs that may retain customer content for up to 30 days, subject to applicable exceptions and controls.</p>
<p>Anthropic documents its own retention arrangements, including zero-data-retention options for eligible organizations and applicable features.</p>
<p>These arrangements depend on the provider, product, feature, account eligibility, and contractual terms. Review the current documentation before sending sensitive information.</p>
<p>Before providing sensitive data, you should ensure the following:</p>
<ul>
<li><p>That the provided data will not be used for model training.</p>
</li>
<li><p>What kind of data can be stored and how long.</p>
</li>
<li><p>That the zero data retention policy is available for the chosen contract and features.</p>
</li>
<li><p>Which features store files, conversation, and application state.</p>
</li>
<li><p>That the contract satisfies the requirements of your organization.</p>
</li>
</ul>
<p>For provider-specific details, review the <a href="https://developers.openai.com/api/docs/guides/your-data">OpenAI API data controls</a> and <a href="https://platform.claude.com/docs/en/build-with-claude/api-and-data-retention">Anthropic API data-retention documentation</a>.</p>
<h2>Validating Inputs and Outputs</h2>
<p>Input validation and output validation cover two distinct sets of problems.</p>
<p>Before you make a request, validate its fields, its size, and the permissions of the person who has submitted the request to ensure that the information accessed is legitimate.</p>
<p>When processing the output, do not rely on the assumption that the data returned by the model will always be right and safe.</p>
<p>For instance, in case the model was supposed to return a JSON object with a category and a priority, then validate it first.</p>
<p>AI Response -&gt; Parse Response -&gt; Validate Schema -&gt; Check Business Rules -&gt; Accept or Reject</p>
<p>Model output must be treated as untrusted input. In case the output will be used for queries in the database, an HTML page, a shell command, or some other application, use proper validation and escaping for the respective destination.</p>
<p>Prompt injection also needs to be considered when the model is processing uploaded documents, web pages, or other untrusted inputs. The instructions contained in such inputs must not override application access control policy.</p>
<h2>Maintaining Useful Logs Without Saving All Information</h2>
<p>Logs assist programmers in troubleshooting failed requests, odd behavior, and integration problems. On the other hand, saving the full request/response can end up storing yet another copy of private information.</p>
<p>An example of what a more limited log entry might include:</p>
<p>{</p>
<p>"request_id": "req_1042",</p>
<p>"operation": "support_summary",</p>
<p>"status": "success",</p>
<p>"duration_ms": 840,</p>
<p>"provider": "configured_provider"</p>
<p>}</p>
<p>The values are purely illustrative. The idea here is to log enough details for trouble-shooting the system behavior without needlessly duplicating customer data.</p>
<p>If there is ever a need to log payloads for debugging purposes, limit who has access and establish a retention period.</p>
<h2>Limit Access and Track Usage</h2>
<p>A secure integration will set appropriate boundaries for which users can make requests to the <a href="https://jbcodeapp.com/what-we-do/ai-ml-solutions/">AI service</a> and what those requests can do.</p>
<p>Some useful measures to implement:</p>
<p>Authorization on a per-user or per-service basis Request and budget constraints Limited access to external networks, where applicable Different accounts for development, test, and production environments Audit logs for critical actions Notifications of abnormal activity or expenditures</p>
<p>Never allow access to internal databases or other external systems for an AI-driven process without limitations just because it could be needed sometime in the future.</p>
<p>If an action needs access to a user’s account, the application must verify the permission first.</p>
<h2>Security Checklist for Prior to Deployment</h2>
<p>Prior to implementing an integration with an AI API, ensure the following points:</p>
<ul>
<li><p>Request payloads are free from unnecessary details.</p>
</li>
<li><p>Identifiers are either masked or substituted as required.</p>
</li>
<li><p>API keys of the provider are kept on the server.</p>
</li>
<li><p>User authorization occurs before accessing data.</p>
</li>
<li><p>Proper configurations of TLS and other storage mechanisms are in place.</p>
</li>
<li><p>Retention and training policy of the provider are considered.</p>
</li>
<li><p>Validations of inputs and model outputs take place.</p>
</li>
<li><p>Sensitive details are avoided in the logs.</p>
</li>
<li><p>Malformed inputs, unexpected outputs, and failure conditions are tested.</p>
</li>
</ul>
<h2>Concluding Remarks</h2>
<p>An API connection to the AI security system is just as much about data management as it is about credential management.</p>
<p>The most efficient course of action is to reduce the amount of data sent to the machine learning model, store credentials safely on the server, understand the length of time credentials are stored by the vendor, authenticate all responses, and restrict access to data itself.</p>
<p>This approach should be considered from the start and not applied only when the sensitive data has been inputted into the system.</p>
]]></content:encoded></item><item><title><![CDATA[How HRMS Systems Handle Multiple Work Locations]]></title><description><![CDATA[The challenge of managing employees in more than one office, branch, remote site, or worksite involves a data challenge that is not faced by an HR system…]]></description><link>https://rohitjart.hashnode.dev/how-hrms-systems-handle-multiple-work-locations</link><guid isPermaLink="true">https://rohitjart.hashnode.dev/how-hrms-systems-handle-multiple-work-locations</guid><dc:creator><![CDATA[Rohit P]]></dc:creator><pubDate>Thu, 08 Oct 2026 06:36:39 GMT</pubDate><content:encoded><![CDATA[<p>The challenge of managing employees in more than one office, branch, remote site, or worksite involves a data challenge that is not faced by an HR system based on a single worksite.</p>
<p>The HRMS should be aware of who the employee is, where the employee should work, what regulations apply to that place, and how changes in location affect attendance, absence, payroll, and reporting.</p>
<h2>Employee Work Location is More than Just an Address</h2>
<p>Employee work location should generally be considered structured HR data, not merely recording the address of the office at which the employee works within the profile of that employee.</p>
<p>Some examples could include the following for a company:</p>
<p>New York office Mumbai office Remote employees Project locations</p>
<p>The employee data would be linked to the location code, while the location will include data like the name of the location, timezone, work schedule, and policies.</p>
<p>This allows changing location data without having to change historical employee data.</p>
<h2>The Usage of Location Information in Attendance System</h2>
<p>Information about the location becomes especially important when <a href="https://getbiz.solutions/hrms-software/attendance-management-system/">attendance system</a> is concerned.</p>
<p>The process may be schematically presented in the following way:</p>
<p>Employee</p>
<p>↓</p>
<p>Assignment of Work Location</p>
<p>↓</p>
<p>Attendance Event</p>
<p>↓</p>
<p>Location Verification</p>
<p>↓</p>
<p>Attendance Entry</p>
<p>↓</p>
<p>Calculation of Working Hours</p>
<p>Depending on the system used, an attendance event may have a timestamp, identification of the employee, device identification, and location information.</p>
<p>Then the HRMS will be able to verify if the event is valid for the assigned work location or work agreement.</p>
<p>It differs from a situation when employees should attend from the only location.</p>
<h2>Employees Can Be Transferred To Different Locations</h2>
<p>Many real-life businesses transfer their employees to different locations.</p>
<p>An employee can:</p>
<p>be transferred to another location permanently be transferred to a temporary project location move from office job to telecommuting job travel to approved locations</p>
<p>It is necessary for a good HRMS to separate an employee's current location from his/her past locations.</p>
<p>For instance:</p>
<p>Employee ID: 1042</p>
<p>Year 2025 → Location A Year 2026 → Location B</p>
<p>Here, we don't simply replace Location A with Location B. It helps in understanding the past attendance and HR records.</p>
<h2>Location Affects Other HRMS Modules</h2>
<p>Location of work can affect much more than just attendance.</p>
<p>For example, it can be used to:</p>
<p>Attendance: Locations may have their own working schedule or attendance policy.</p>
<p>Leave: There can be differences in holiday calendars at various locations.</p>
<p>Payroll: The company can configure its HRMS in such a way that location affects payroll process.</p>
<p>Reporting: HR departments might require reports sorted by office, branch, region or work place.</p>
<p>Therefore, location should be considered part of shared HRMS data and not an independent variable.</p>
<h2>A Common Issue in Data Modelling</h2>
<p>It is common to store the location as editable data:</p>
<p>work_location = "Mumbai Office"</p>
<p>It gets problematic when the office name changes or when many records contain different versions of the same name.</p>
<p>The correct solution will involve storing:</p>
<p>employee_id location_id effective_from effective_to</p>
<p>The actual location will be stored separately.</p>
<p>It will also simplify reporting on history since the system will be able to ascertain the location at a certain time period.</p>
<h2>And What about Telecommuting Employees?</h2>
<p>Telecommuting brings additional complexity.</p>
<p>The telecommuting employee will be assigned a home location, but he/she will also be permitted to work in other approved locations.</p>
<p>This means that HRMS should be able to differentiate between:</p>
<p>Assigned location – the employee’s usual working location.</p>
<p>Attendance location – the location where the attendance event took place, when location tracking is implemented.</p>
<p>Approved temporary location – the location that has been temporarily approved for a certain period of time.</p>
<p>Differentiating between these terms will help avoid confusion between attendance and assignment data.</p>
<h2>Takeaway Lesson</h2>
<p>HRMS for multiple locations is inherently a matter of data and process management.</p>
<p>For the system to be robust, it must link employees, locations, attendance events, scheduling, policies, and historical allocation without erasing any pre-existing data.</p>
<p>The core of the design strategy here is quite straightforward:</p>
<p>Present location informs the system about the present location assignment for the employee; historical location data is how it knows about his previous locations.</p>
<p>This separation of concerns greatly simplifies the management of attendance, reporting, payroll, etc. processes as the business grows.</p>
]]></content:encoded></item></channel></rss>