Companies ensure data privacy and security in serverless architecture by implementing robust measures like encryption, access controls, and audits. Choosing reputable third-party providers with strong security protocols further mitigates risks.